Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[FIXED JENKINS-27828] Use artifact ID as module name if pom defines n…
Browse files Browse the repository at this point in the history
…o name.
  • Loading branch information
uhafner committed Apr 14, 2015
1 parent 002d64e commit e7a42b2
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 255 deletions.
Expand Up @@ -214,6 +214,11 @@ private String parseBuildXml(final String buildXml) {
* resolved
*/
private String parsePom(final String pom) {
String name = parsePomAttribute(pom, "name");
return StringUtils.defaultIfBlank(name, parsePomAttribute(pom, "artifactId"));
}

private String parsePomAttribute(final String pom, final String tagName) {
InputStream file = null;
try {
file = factory.create(pom);
Expand All @@ -222,9 +227,9 @@ private String parsePom(final String pom) {
digester.setClassLoader(ModuleDetector.class.getClassLoader());

digester.push(new StringBuffer());
digester.addCallMethod("project/name", "append", 0);
digester.addCallMethod("project/" + tagName, "append", 0);

StringBuffer result = (StringBuffer)digester.parse(file);
StringBuffer result = digester.parse(file);
return result.toString();
}
catch (IOException exception) {
Expand Down

0 comments on commit e7a42b2

Please sign in to comment.