From f4d895595e2ab6393a57a987563f7c568c219215 Mon Sep 17 00:00:00 2001 From: Michal Karm Babacek Date: Fri, 30 Aug 2019 14:21:49 +0200 Subject: [PATCH] Fixes issue 203, suffixes for artifactIds If there are two projects generated, artifactId gets suffixed with service-a and service-b while the final name of the war/jar remains the same as the original artifactId. Signed-off-by: Michal Karm Babacek --- .../servers/MicroprofileServersAddon.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java index 613a3156..5fb0b358 100755 --- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java +++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java @@ -35,7 +35,11 @@ import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import static org.eclipse.microprofile.starter.core.model.JessieModel.Parameter.MICROPROFILESPECS; @@ -145,6 +149,16 @@ public void adaptMavenModel(Model pomFile, JessieModel model, boolean mainProjec mavenHelper.addDependency(pomFile, "org.bouncycastle", "bcpkix-jdk15on", "1.53"); } + if (model.hasMainAndSecondaryProject()) { + String artifactID = pomFile.getArtifactId(); + if (mainProject) { + pomFile.setArtifactId(artifactID + "-" + JessieModel.MAIN_INDICATOR); + } else { + pomFile.setArtifactId(artifactID + "-" + JessieModel.SECONDARY_INDICATOR); + } + pomFile.getBuild().setFinalName(artifactID); + } + } private Profile findProfile(String profileName) {