tags:

views:

21

answers:

1

Hi, on my Windows machine I do have several proeject that I build with maven. At the moment they are all in SNAPSHOT-State. When I build a project that relies on one of the other projects maven always adds the class files of the other projects to the jar. If I build the project on my CI-Server this problem does not occur. Does anyone have an idea why maven adds the class files to my jar?

I'm using maven 2.2.1

+1  A: 

When I build a project that relies on one of the other projects maven always adds the class files of the other projects to the jar.

This is not a default behavior and, if it happens, you're somehow telling Maven to do so. If you want to hunt potential discrepancies, check the effective-pom, the effective-settings, the active-profiles using the following goals on both machines:

  • help:effective-pom
  • help:effective-settings
  • help:active-profiles

Also double check how Maven is invoked on the CI machine (extra command line parameter, etc).

Pascal Thivent
Thank you for your hint. Unfortunately the results of the commands on both of the two machines look exactly the same. Only the paths are different. I took another look at the jar file created on my windows machine. Only the class files that the project I build depends on are included in the build.
soeren
@soeren Sadly, I'm afraid it will be hard to help further without a pom allowing to reproduce.
Pascal Thivent
I finally found the problem. It had nothing to do with maven but with the installed jdk. I usedon a pretty old version 6 jdk. With the new version of the jdk it works fine now. Anyway thank you for your help. I appreciate that.
soeren