Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove pom properties revision property #423

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading