Grails Maven Plugin

Jar files in plugins folder

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven version: 2.0.9
    Java version: 1.6.0_0
    OS name: "linux" version: "2.6.27.19-170.2.35.fc10.x86_64" arch: "amd64" Family: "unix"

Description

Executing the following produces jar files in the plugins folder. I think it is bad to have these in the project tree. Can they be stored outside project tree or included in Maven dependencies? Is there a workaround (such as exclude plugins from version control and re-run install-plugin on checkout)?

$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.0-SNAPSHOT -DarchetypeRepository=http://snapshots.repository.codehaus.org -DgroupId=example -DartifactId=my-app
$ cd my-app
$ mvn initialize
$ mvn grails:install-plugin -DpluginName=gwt
$ find . -name "*.jar"
./plugins/gwt-0.3-SNAPSHOT/lib/gwt-servlet.jar
./plugins/gwt-0.3-SNAPSHOT/lib/grails-gwt-util.jar
./plugins/hibernate-1.1/lib/hibernate-annotations-3.3.0.jar
./plugins/hibernate-1.1/lib/dom4j-1.6.1.jar
./plugins/hibernate-1.1/lib/hibernate-commons-annotations-3.3.0.jar
./plugins/hibernate-1.1/lib/javassist-3.4.GA.jar
./plugins/hibernate-1.1/lib/hibernate3-3.3.1.jar

Issue Links

Activity

Hide
Mingfai Ma added a comment -

this is fixed in 1.1

Show
Mingfai Ma added a comment - this is fixed in 1.1
Hide
Peter Ledbrook added a comment -

It's not fixed for the Maven plugin. As to whether it's a bad idea, I much prefer them in that directory than in the default Grails location (~/.grails/...). Personal preference comes into it somewhat.

That said, there should be a configuration setting for this. As for a workaround, it should be pretty easy to exclude that directory from source control.

The reason that the plugins are installed there is because Maven generates all its files into the target directory by default (which is also in the source tree don't forget!). I wanted to stick to that convention without putting the plugins in the target directory itself (otherwise they would have been deleted every time you did a clean). The configuration setting should work out for people.

Show
Peter Ledbrook added a comment - It's not fixed for the Maven plugin. As to whether it's a bad idea, I much prefer them in that directory than in the default Grails location (~/.grails/...). Personal preference comes into it somewhat. That said, there should be a configuration setting for this. As for a workaround, it should be pretty easy to exclude that directory from source control. The reason that the plugins are installed there is because Maven generates all its files into the target directory by default (which is also in the source tree don't forget!). I wanted to stick to that convention without putting the plugins in the target directory itself (otherwise they would have been deleted every time you did a clean). The configuration setting should work out for people.
Hide
Peter Ledbrook added a comment -

GRAILS-4274 describes adding such a configuration setting.

Show
Peter Ledbrook added a comment - GRAILS-4274 describes adding such a configuration setting.
Hide
Vladimir Nicolici added a comment -

I think the current structure of the project tree is a mess. Log files, reports, etc. are mixed with source files in the same directories. This makes it difficult to put the project under source control. You have to be very careful, otherwise you end up with stacktrace.log, TESTS-TestSuites.xml, and the plugins directory under source control. It's even worse when you create the application from the maven grails archetype.

The standard maven directory structure is much better, having only src as a source directory, and target as a temporary directory to be used in the build process. You only have to add the target directory to the SCM ignore list, and not have to worry about having build artifacts and dependencies on the SCM server.

Ideally, the projects structure should be similar to a maven project. This would probably also help the maven grails plugin.

Show
Vladimir Nicolici added a comment - I think the current structure of the project tree is a mess. Log files, reports, etc. are mixed with source files in the same directories. This makes it difficult to put the project under source control. You have to be very careful, otherwise you end up with stacktrace.log, TESTS-TestSuites.xml, and the plugins directory under source control. It's even worse when you create the application from the maven grails archetype. The standard maven directory structure is much better, having only src as a source directory, and target as a temporary directory to be used in the build process. You only have to add the target directory to the SCM ignore list, and not have to worry about having build artifacts and dependencies on the SCM server. Ideally, the projects structure should be similar to a maven project. This would probably also help the maven grails plugin.
Hide
Burt Beckwith added a comment -

Newer plugins will use Ivy for dependency management.

Show
Burt Beckwith added a comment - Newer plugins will use Ivy for dependency management.

People

Vote (3)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: