Question

I have a pom.xml profile set up that calls Maven (2.2.1) assembly to create a custom artifact that we'll upload to a third-party vulnerability assessment tool. The configuration is very straightforward - stripped to its essentials it's

<dependencySet>
   <includes>
      <include>${project.groupId}:*:jar</include>
   </include>
   <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
</dependencySet>

<dependencySet>
   <outputDirectory>lib</outputDirectory>
   <includes/>
   <excludes>
      <exclude>${project.groupId}:*</exclude>
   </excludes>
</dependencySet>

That is - the top level directory has our jars, stripped of version info, and all of the dependencies are in a /lib directory and include version info.

This is pretty straightforward and it works on my desktop.

On the Jenkins server everything is slammed into the top directory and version info is stripped.

My first thought was that there might be a problem with ${project.groupId} on the server. That seems unlikely but is an obvious thing to check. Unfortunately the problem remains.

It's not because it's tar.gz either - I see the same behavior with .zip?

Any ideas?

Was it helpful?

Solution

We finally tracked down the problem. The pom.xml file did not contain an explicit version for maven-assembly-plugin and I didn't notice it since everything worked.

Later, after we pushed to the build server, it failed. We verified that the maven versions matched but didn't think to check the plugin versions since all other dependencies require explicit version values. Once we did think to add the version (2.2-beta-4, to start) it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top