1

Anyone knows how to create a domain class automatically in groovy?

Here is my BuildConfig.groovy:

grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        // uncomment to disable ehcache
        // excludes 'ehcache'
    }
    log "warn"
 // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    repositories {
        grailsCentral()
        // uncomment the below to enable remote dependency resolution
        // from public Maven repositories
        mavenCentral()
        //mavenLocal()
        //mavenRepo "http://snapshots.repository.codehaus.org"
        //mavenRepo "http://repository.codehaus.org"
        //mavenRepo "http://download.java.net/maven/2/"
        //mavenRepo "http://repository.jboss.com/maven2/"
    ebr()
    }
    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
grails.project.dependency.resolution = { plugins{compile ":svn:1.0.2" } }
        // runtime 'mysql:mysql-connector-java:5.1.5'
    }

    plugins {
        build(":tomcat:$grailsVersion",
              ":release:1.0.0") {
            export = false
        }
    }
}
1
  • What do you mean by "automatically"? Commented Jul 13, 2012 at 12:57

1 Answer 1

1

If you mean automatically create a groovy domain starting from the database table you can try with the db reverse plugin

Sign up to request clarification or add additional context in comments.

5 Comments

Following error occured when am trying to install db reverse plugin
:::::::::::::::::::::::::::::::::::::::::::::: :: UNRESOLVED DEPENDENCIES :: :::::::::::::::::::::::::::::::::::::::::::::: :: org.grails.plugins#svn;1.0.0.M1: not found :::::::::::::::::::::::::::::::::::::::::::::: | Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information): - org.grails.plugins#svn;1.0.0.M1: not found
Add this dependencies in your BuildConfig.groovy grails.project.dependency.resolution = { plugins{ compile ":svn:1.0.2" } }
Again the same error...dependencies { grails.project.dependency.resolution = { plugins{compile ":svn:1.0.2" } } } any mistake in this dependency code???
try run "grails refresh-dependencies" and then "grails dependency-report" and see in the report if svb 1.0.0.M1 is still pulled in and by who

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.