Details
-
Bug
-
Status: Reopened (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
Platform: All, OS: All
Description
If "Use private Maven repository" is set for maven build, then it should also be
set for any configured M2 Extra Build Steps.
Currently, the flags passed to the main mvn task to use the private repository
i.e.:
Executing Maven: -B -f /opt/hudson/.hudson/jobs/MYJOB/workspace/pom.xml
-Dmaven.repo.local=/opt/hudson/.hudson/jobs/MYJOB/workspace/.repository package
are not passed to the maven that is invoked from any of these extra build steps.
i.e.:
[workspace] $ /opt/apache-maven-2.0.9/bin/mvn clean
The m2-extra-steps plugin doesn't actually handle the Maven execution (or shell,
or Ant, etc) of the extra steps - they run the same as they would in a freestyle
project. As a result, they're completely unaware of anything set for the POM,
MAVEN_OPTS, private repository, etc for the main Maven execution of the job. If
you want to have the extra steps use the main Maven execution's private
repository, you'll want to click on the Advanced button for your Maven extra
step, and add "maven.repo.local=${WORKSPACE}/.repository" to the Properties
field. That'll make sure the Maven invocation in your extra step has the needed
-Dmaven.repo.local=... in its arguments.