This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1098295 - Saving Project Through GUI Overwrites POM
(cherry picked from commit 080e9e0)
- Loading branch information
Showing
4 changed files
with
39 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,13 @@ private String toString(POM pom, | |
model.addRepository(fromClientModelToPom(repository)); | ||
} | ||
} else { // If it is a kjar | ||
model.setPackaging(PACKAGING); | ||
|
||
if(isPackagingSet(model)){ | ||
// Currently we only support multimodules and kjars. | ||
// But since the user can change and customers have actually changed the packaging to jar | ||
// we do not overwrite the setting. | ||
model.setPackaging(PACKAGING); | ||
} | ||
if (pom.getParent() != null) { | ||
Parent parent = new Parent(); | ||
parent.setGroupId(pom.getParent().getGroupId()); | ||
|
@@ -111,6 +117,10 @@ private String toString(POM pom, | |
return stringWriter.toString(); | ||
} | ||
|
||
private boolean isPackagingSet(Model model) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Rikkola
Author
Member
|
||
return model.getPackaging() == null || model.getPackaging().isEmpty(); | ||
} | ||
|
||
/** | ||
* @param gavModel The model that is saved | ||
* @param originalPomAsText The original pom in text form, since the guvnor POM model does not cover all the pom.xml features. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based on what it actually returns, should't this method be called
isPackagingNotSet(Model model)
?