It's not clear what dependencies are pulled in when running Grails tasks from Maven. I ran into a number of problems using the Maven plugin that resulted from it pulling its dependencies, rather than the dependencies defined by my Grails application.
For instance, I was using the recently grails-1-1 beta, but the SNAPSHOT grails-maven-plugin I was using pulled in an older version of grails-bootstrap, which transitively pulled in Groovy 1.5.x. The result is running mvn grails:run-app got bizzare method missing exceptions since the old version of Groovy was loaded.
I think the best way to address this is to defer to the user's application (their Maven project's pom.xml) to define ALL needed dependencies. They would define them as "test" or "provided" dependencies as appropriate. That way I can look at the transitive dependencies of my project and know exactly what I'm pulling in. (Commands like mvn dependency:tree can be used to see this.)
There is some precedence for this approach, such as with the maven-surefire-plugin. That plugin determines what version of JUnit or TestNG to use from the consumer's project rather than linking to JUnit itself.
I'll be happy to contribute to this effort, but wanted to discuss the strategy first.
It's not clear what dependencies are pulled in when running Grails tasks from Maven. I ran into a number of problems using the Maven plugin that resulted from it pulling its dependencies, rather than the dependencies defined by my Grails application.
For instance, I was using the recently grails-1-1 beta, but the SNAPSHOT grails-maven-plugin I was using pulled in an older version of grails-bootstrap, which transitively pulled in Groovy 1.5.x. The result is running mvn grails:run-app got bizzare method missing exceptions since the old version of Groovy was loaded.
I think the best way to address this is to defer to the user's application (their Maven project's pom.xml) to define ALL needed dependencies. They would define them as "test" or "provided" dependencies as appropriate. That way I can look at the transitive dependencies of my project and know exactly what I'm pulling in. (Commands like mvn dependency:tree can be used to see this.)
There is some precedence for this approach, such as with the maven-surefire-plugin. That plugin determines what version of JUnit or TestNG to use from the consumer's project rather than linking to JUnit itself.
I'll be happy to contribute to this effort, but wanted to discuss the strategy first.