Bug #580

maven template dependency classifier naming issue

Added by David Leins almost 4 years ago. Updated almost 4 years ago.

Status:ResolvedStart date:2018-08-09
Priority:NormalDue date:
Assignee:Jan Moringen% Done:


Category:-Spent time:-
Target version:-


I have encountered a problem while building a series of java applications with the maven template.

Short description: some dependencies stated in the pom.xml are filed under a wrong name in the '.dependencies' folder of the jobs workspace.
This seems to occur when a 'classifier' tag is provided in a dependency definition, which is included in the filename but not searched for by the 'deploy-file' command being run afterwards.

For instance the jacoco 'aware-core' project of the 'fleximir-nightly' distribution is affected.
The jacoco-maven-plugin dependecy itself depends on jacoco-agent, which is defined as follows:



The build fails at this point:

     mvn -B deploy:deploy-file -Dmaven.repo.local=/home/zirkon/.m2/repo-toolkit-fleximir-nightly -Durl=file:///vol//fleximir-nightly//share/repository -Dfile=.dependencies/org.jacoco.agent-0.8.1.jar -DgeneratePom=false -DpomFile=.dependencies/org.jacoco.agent-0.8.1.pom -Dpackaging=jar
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building AWARe Core Engine 0.0.4-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ aware-core ---
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.488 s
    [INFO] Finished at: 2018-08-08T16:53:59+02:00
    [INFO] Final Memory: 11M/240M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project aware-core: /home/zirkon/citk/jenkins/jobs/aware-core-imemo-ci-deploy-fleximir-nightly/workspace/.dependencies/org.jacoco.agent-0.8.1.jar not found. -> [Help 1]

Checking the content of '.dependecies' with 'ls workspace/.dependecies | grep -i jacoco.agent':


The same problem occurs with sisu-guice, where 'sisu-guice-2.1.7.jar' is searched, but inside the .dependencies folder the jar is named 'sisu-guice-2.1.7-noaop.jar'.



Renaming the affected jars between the download/caching and installation process is a workaround to get the build to succeed.

Associated revisions

Revision c6c0feeb
Added by Johannes Wienke almost 4 years ago

Support deploying jars with classifiers

This commit enables deploying jars with classifiers to the local
distribution repository. For each pom file now multiple jars will be
uploaded (if they exists) and they will be tagged with the appropriate

fixes #580


#1 Updated by Johannes Wienke almost 4 years ago

dleins: currently maven.template canonically constructs the name of the jar file from the pom by stripping the .pom extension and replacing it with .jar. This seems to be the culprit here.

Could you try the following patch an test whether it solves your issue:

diff --git a/templates/toolkit/maven.template b/templates/toolkit/maven.template
index cb8a20f6..28f6f3d0 100644
--- a/templates/toolkit/maven.template
+++ b/templates/toolkit/maven.template
@@ -37,9 +37,11 @@
 if ls .dependencies/*.pom >/dev/null 2>&1;
     for pom in .dependencies/*.pom; do
-        jar=\"\\${pom%%.pom}.jar\" 
-        maven_install_with_pom \"\\${jar}\" \"\\${pom}\" \"${maven.install.skip|i}\" 
-        maven_install_flat_jar \"\\${jar}\" 
+        for  jar in \\${pom%%.pom}*.jar
+        do
+            maven_install_with_pom \"\\${jar}\" \"\\${pom}\" \"${maven.install.skip|i}\" 
+            maven_install_flat_jar \"\\${jar}\" 
+        done
 for jar in \\$(find . -wholename '*/target/*.jar'); do

#2 Updated by Anonymous almost 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF