Skip to content

Commit 89ff587

Browse files
authored
Merge pull request quarkusio#49888 from aloubyansky/clone-model
Clone POM model before modifying it
2 parents e05b801 + 0a49087 commit 89ff587

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

devtools/maven/src/main/java/io/quarkus/maven/QuarkusBootstrapProvider.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ static void setProjectModels(QuarkusBootstrapMojo mojo, BootstrapMavenContextCon
110110
* @return raw POM
111111
*/
112112
private static Model getRawModel(MavenProject mp) {
113-
final Model model = mp.getOriginalModel();
113+
Model model = mp.getOriginalModel();
114114
if (model.getDependencyManagement() == null) {
115+
// clone the model to not modify the original model associated with the project,
116+
// otherwise, the enforcer plugin may fail, for example
117+
model = model.clone();
115118
// this could be the flatten plugin removing the dependencyManagement
116119
// in which case we set the effective dependency management to not lose the platform info
117120
model.setDependencyManagement(mp.getDependencyManagement());

0 commit comments

Comments
 (0)