开发者

Maven Grails Building with 'mvn clean install' doesn't work

I've built a Maven Grails project which can be build fine using command mvn grails:war.

However, using the standard mvn install fails to work - I get exceptions complaining that a util Java class (held under the grails-app/util folder) can't compile because it can't find one of the domain classes.

I'm n开发者_开发知识库ot using any package structures, so the domain class isn't imported to the util class.

I suppose my first question is - does Maven fully support the building of a mavenised Grails project? Should I be expecting mvn install to work?

My second question is - If i'm forced to build the app using mvn grails:war - how do I enforce this when the parent project / pom has it as a dependant module?


I suppose my first question is - does Maven fully support the building of a mavenised Grails project? Should I be expecting mvn install to work?

According to Developer - Maven Integration, yes, definitely. Did you follow the steps detailed in Maven Integration? Did you use the grails archetype to create your project? Is it really using a packaging of type grails-app?

My second question is - If i'm forced to build the app using mvn grails:war - how do I enforce this when the parent project / pom has it as a dependant module?

According to the lifecycle of a project with a packaging of type grails-app, the grails:war goal is bound to the package phase. In other words, nothing forces you to call grails:war, just call mvn package (and actually, you should do this) or any other standard phase posterior to package.

So, to answer your question, just use a <packaging>grails-app</packaging> for the grails module and maven will do its job during a reactor build.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜