geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Dillon" <>
Subject Re: Handling of LICENSE.txt and NOTICE.txt on trunk
Date Sun, 27 Aug 2006 07:50:48 GMT
I've implemented another solution, this time not dragging all of the
classes that Groovy needs into the classloader, which appears to have
caused the car plugin to freak out.

I added a new mojo to the tools-maven-plugin, 'copy-legal-files' that
is very specific and only handles the copy of the LICENSE.txt and
NOTICE.txt files for inclusion into archives, as in:


I have also cleaned up the remaining (I think) resource includes that
were causing the Eclipse plugin to generate bunk .classpath files.  If
someone want to give it a whirl and let me know if Eclipse complains
about any overlapping directories...


On 8/21/06, Jason Dillon <> wrote:
> I recently discovered that if a parent pom adds an antrun plugin
> execution to build, that children can not add dependencies, which
> causes some problems further down in the build.  I was going to use
> antrun to install LICENSE.txt and NOTICE.txt into target/classes/META-
> INF as a work around to the problem that occurs when we added them to
> build/resources that caused the maven-eclipse-plugin to barf.
> So I finally gave up and create a new plugin which allows Groovy
> scripts to be executed inline and with the AntBuilder we can execute
> Ant bits, as well as perform logic operations all within a pom.  And
> I setup the project-config pom to add an execution that will copy
> LICENSE.txt and NOTICE.txt from the module root to target/classes/
> META-INF for all modules unless the packaging is pom, with:
>      <plugin>
>          <groupId>org.apache.geronimo.genesis.plugins</groupId>
>          <artifactId>script-maven-plugin</artifactId>
>          <version>1.0.0-SNAPSHOT</version>
>          <executions>
>              <execution>
>                  <id>install-licenses-and-notice</id>
>                  <phase>generate-resources</phase>
>                  <goals>
>                      <goal>groovy</goal>
>                  </goals>
>                  <configuration>
>                      <code>
>                          if (project.packaging != "pom") {
>                              def ant = new AntBuilder()
>                              def dir = "${project.basedir}/target/
> classes/META-INF"
>                              ant.mkdir(dir: dir)
>                              ant.copy(todir: dir) {
>                                  fileset(dir: "${project.basedir}") {
>                                      include(name: "LICENSE.txt")
>                                      include(name: "NOTICE.txt")
>                                  }
>                              }
>                          }
>                      </code>
>                  </configuration>
>              </execution>
>          </executions>
>      </plugin>
> The new script-maven-plugin is a tad different than the groovy-maven-
> plugin in the mojo sandbox, primarily allows the code for the script
> to be defined in the pom or at an external URL.  Also allows extra
> dependencies to be added outside of the normal Maven plugin
> dependency mechanism, since antrun has shown that it is broken for
> parent and child configurations.
> There are still however a few issues remaining that prevent `mvn
> eclipse:eclipse` from generating clean .classpath files, which will
> be fixed when we move modules to use the standard m2 layout.
> --jason

View raw message