Skip to content
Permalink
Browse files

[FIXED JENKINS-21279]

Not sure packaging doesn't defeault to "jar", which seems to be the default, but being defensive.
  • Loading branch information...
kohsuke committed Mar 11, 2014
1 parent dae6ef3 commit 4bdfef299f07fabedcb43b902d5ddfc05d62f8cd
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/main/java/hudson/maven/MavenModuleSetBuild.java
@@ -187,16 +187,22 @@ public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedE
MavenModule root = getProject().getRootModule();
if (root!=null) {// I don't think it can ever be null but let's be defensive
// TODO: this needs to be documented but where?
envs.put("POM_DISPLAYNAME", root.getDisplayName());
envs.put("POM_VERSION", root.getVersion());
envs.put("POM_GROUPID", root.getGroupId());
envs.put("POM_ARTIFACTID", root.getArtifactId());
envs.put("POM_PACKAGING", root.getPackaging());
envs(envs, "POM_DISPLAYNAME", root.getDisplayName());
envs(envs, "POM_VERSION", root.getVersion());
envs(envs, "POM_GROUPID", root.getGroupId());
envs(envs, "POM_ARTIFACTID", root.getArtifactId());
envs(envs, "POM_PACKAGING", root.getPackaging());
}

return envs;
}

private void envs(EnvVars env, String key, String value) {
// TODO: switch to EnvVars.putIfNotNull when we pick up a newer core
if (value!=null)
env.put(key,value);
}

/**
* Displays the combined status of all modules.
* <p>

0 comments on commit 4bdfef2

Please sign in to comment.
You can’t perform that action at this time.