Skip to content

Commit

Permalink
[FIXED JENKINS-21279]
Browse files Browse the repository at this point in the history
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 4bdfef2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/hudson/maven/MavenModuleSetBuild.java
Expand Up @@ -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>
Expand Down

0 comments on commit 4bdfef2

Please sign in to comment.