Hi,
Peter Horlock schrieb:
Hi Rémy, thanks for your reply. I also tried mvn package -Pmyflag, but this
did't work out either - btw -p SPACE FLAG is what is said on the maven docu
site:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html :
mvn groupId:artifactId:goal -P profile-1,profile-2
However, the new Maven - The definitive Guide - Pdf book says -PMYFLAG.
-------
Next, as you suggested, I tried it directly without a profile, and it
neither worked :-(
I am not even sure if what I am trying is supposed to be working - I
am trying to exclude certain classes or package - not simple
exluding a certain src folder, like "include "src/java" but exclude
"src/java2" or so - I am trying to do in on a package or class basis -
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<excludes>
<exclude>**/com/mycompany/mypackage/mysubpackage/MyClassA.java</exclude>
<exclude>**/com/mycompany/mypackage/mysubpackage/packageA/*</exclude>
<exclude>**/com/mycompany/mypackage/mysubpackage/packageB/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
I suppose the exclude paths are wrong - but how should I define them?
src/java/com...?
The jar-plugin works on the compiled output in target/classes, so
ecluding *.java files can't work. I just tried with a simple test project:
.
|-- pom.xml
`-- src
`-- main
`-- java
|-- pkg1
| |-- Class1.java
| `-- Class2.java
`-- pkg2
|-- Class1.java
`-- Class2.java
and this plugin configuration in the pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>pkg1/Class1.class</exclude>
<exclude>pkg2/**</exclude>
</excludes>
</configuration>
</plugin>
After 'mvn package' the resulting jar contained just pkg1/Class2.class,
just as expected.
Thanks in advance,
Peter
Hope this helps
-Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]