Skip to content

Commit

Permalink
JENKINS-7010: Maven settings configured at Maven job level aren't use…
Browse files Browse the repository at this point in the history
…d inside the promotion step - Fix issue
  • Loading branch information
aheritier committed Oct 23, 2015
1 parent bd76d48 commit a2bcad0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/hudson/maven/RedeployPublisher.java
Expand Up @@ -213,7 +213,14 @@ private MavenEmbedder createEmbedder(TaskListener listener, AbstractBuild<?,?> b
File tmpSettings = File.createTempFile( "jenkins", "temp-settings.xml" );
try {
AbstractProject project = build.getProject();


// JENKINS-7010: If the publisher is used inside a promotion
// we need to retrieve the settings from the parent project
// NOTE: Do not use instanceof to not have a dependency to the promotion plugin
if ("hudson.plugins.promoted_builds.PromotionProcess".equals(project.getClass().getName())) {
project = project.getRootProject();
}

if (project instanceof MavenModuleSet) {
MavenModuleSet mavenModuleSet = ((MavenModuleSet) project);
profiles = mavenModuleSet.getProfiles();
Expand Down

0 comments on commit a2bcad0

Please sign in to comment.