Skip to content

Commit

Permalink
remove pom properties revision property
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyu162 committed Jul 24, 2024
1 parent b0c8e9d commit 5032dfb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,13 @@ protected Model createFlattenedPom(File pomFile) throws MojoExecutionException,
}
}

// remove pom.xml properties revision property
String oldVersion = originalPom.getVersion();
if (oldVersion != null && !oldVersion.isEmpty() && oldVersion.startsWith("${") && oldVersion.endsWith("}")) {
getLog().info("find version " + oldVersion + " remove to properties");
flattenedPom.getProperties().remove(oldVersion.substring(2, oldVersion.length() - 1));
}

return flattenedPom;
}

Expand Down Expand Up @@ -922,9 +929,9 @@ protected Model createEffectivePom(
}
}
};

buildingResult = modelBuilderThreadSafetyWorkaround.build(
buildingRequest, customInjector, new DefaultProfileSelector());

} catch (ModelBuildingException e) {
throw new MojoExecutionException(e.getMessage(), e);
}
Expand Down

0 comments on commit 5032dfb

Please sign in to comment.