Grails Maven Plugin

Maven integration in 1.3.1 is broken

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu Linux, Grails 1.3.1

Description

The latest archetype for Grails can generate only 1.2.2 based apps. Trying to solve this I created project manually with grails create-app using Grails 1.3.1. Then created pom.xml with mvn grails:create-pom. Generated pom contained dependencies to grails 1.2.2 (grails, grails-gorm). I changed them to 1.3.1 as I found such artefacts in repo.

Then runned mvn grails:run-app and received missing dependencies for grails-gorm (hibernate-commons-annotations 3.4.0.GA instead of 3.3.0.ga), fixed them locally in pom.

Runned mvn grails:run-app again. Everything works fine, but hibernate-1.3.1 and tomcat 1.3.1 plugins claimed that I'm using wrong grails version:

linx@ubuntu:~/projects/tmp/test$ mvn grails:run-app
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - org.test:test:war:0.1
[INFO] task-segment: [grails:run-app]
[INFO] ------------------------------------------------------------------------
[INFO] [grails:run-app {execution: default-cli}]
[INFO] Using Grails 1.3.1
Running pre-compiled script
Environment set to development
Plugin [tomcat-1.3.1] not installed. ...
Plugin [hibernate-1.3.1] not installed. ...
Resolving new plugins. Please wait... ...
Installing zip /home/linx/.ivy2/cache/org.grails.plugins/hibernate/zips/hibernate-1.3.1.zip... ...
[mkdir] Created dir: /home/linx/projects/tmp/test/plugins/hibernate-1.3.1
[unzip] Expanding: /home/linx/.ivy2/cache/org.grails.plugins/hibernate/zips/hibernate-1.3.1.zip into /home/linx/projects/tmp/test/plugins/hibernate-1.3.1
Installed plugin hibernate-1.3.1 to location /home/linx/projects/tmp/test/plugins/hibernate-1.3.1. ...
Plugin hibernate-1.3.1 requires version [1.3 > *] of Grails which your current Grails installation does not meet. Please try install a different version of the plugin or Grails.
[delete] Deleting directory /home/linx/projects/tmp/test/plugins/hibernate-1.3.1
linx@ubuntu:~/projects/tmp/test$

  1. grails-maven-plugin-1.2.2.pom
    05/Jun/10 8:01 AM
    12 kB
    Max Garmash
  2. pom.xml
    26/May/10 5:51 AM
    5 kB
    Max Garmash

Activity

Hide
Eric Sword added a comment -

Just to add a bit more detail based on my own experience:

1) non-existent hibernate-annotations - it should be 3.4.0.ga not 3.4.0.GA
2) non-existent hibernate-commons-annotations - should be 3.1.0.GA (or possibly 3.3.0.ga), not 3.4.0.ga
3) you get version 1.5.8 of most slf4j artifacts, but 1.5.2 of the slf4j-api because that's what hibernate-ehcache includes. Might be helpful to have a <dependencyManagement> entry in the auto-generated POM with the proper version
4) Wrong version of grails reported to plugins, so their minimum-version checks fail (as listed below)

Show
Eric Sword added a comment - Just to add a bit more detail based on my own experience: 1) non-existent hibernate-annotations - it should be 3.4.0.ga not 3.4.0.GA 2) non-existent hibernate-commons-annotations - should be 3.1.0.GA (or possibly 3.3.0.ga), not 3.4.0.ga 3) you get version 1.5.8 of most slf4j artifacts, but 1.5.2 of the slf4j-api because that's what hibernate-ehcache includes. Might be helpful to have a <dependencyManagement> entry in the auto-generated POM with the proper version 4) Wrong version of grails reported to plugins, so their minimum-version checks fail (as listed below)
Hide
Max Garmash added a comment -

Just made a workaround. Fixed some dependencies in grails-maven-plugin-1.2.2.pom

changed
-----------------------------
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-bootstrap</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-scripts</artifactId>
<version>1.2.2</version>
<scope>runtime</scope>
</dependency>
----------------------------
to

<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-bootstrap</artifactId>
<version>1.3.1</version>
</dependency>

<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-scripts</artifactId>
<version>1.3.1</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.apache.ivy</groupId>
<artifactId>ivy</artifactId>
<version>2.1.0</version>
</dependency>

and it worked!

Show
Max Garmash added a comment - Just made a workaround. Fixed some dependencies in grails-maven-plugin-1.2.2.pom changed ----------------------------- <dependency> <groupId>org.grails</groupId> <artifactId>grails-bootstrap</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.grails</groupId> <artifactId>grails-scripts</artifactId> <version>1.2.2</version> <scope>runtime</scope> </dependency> ---------------------------- to <dependency> <groupId>org.grails</groupId> <artifactId>grails-bootstrap</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>org.grails</groupId> <artifactId>grails-scripts</artifactId> <version>1.3.1</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.ivy</groupId> <artifactId>ivy</artifactId> <version>2.1.0</version> </dependency> and it worked!
Hide
Mark Eagle added a comment -

Please fix this for 1.3.2 so we can allow our automated build server to work with the correct configuration.

Show
Mark Eagle added a comment - Please fix this for 1.3.2 so we can allow our automated build server to work with the correct configuration.
Hide
Graeme Rocher added a comment -

already fixed. Once 1.3.2 released there will be a 1.3.2 version of the archetype and plugin

Show
Graeme Rocher added a comment - already fixed. Once 1.3.2 released there will be a 1.3.2 version of the archetype and plugin
Hide
Ron McCamish added a comment -

With the release of Grails 1.3.2, what's the timeline for releasing the grails maven plugin?

Show
Ron McCamish added a comment - With the release of Grails 1.3.2, what's the timeline for releasing the grails maven plugin?
Hide
Ronny Løvtangen added a comment -

1.3.2 of grails maven plugin is already there. http://repo1.maven.org/maven2/org/grails/grails-maven-plugin/1.3.2/

Show
Ronny Løvtangen added a comment - 1.3.2 of grails maven plugin is already there. http://repo1.maven.org/maven2/org/grails/grails-maven-plugin/1.3.2/

People

Vote (6)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: