Skip to content

Commit

Permalink
Fix quarkus maven plugin group ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario authored and rsvoboda committed Sep 16, 2021
1 parent 9004b17 commit c682832
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions testsuite/src/it/java/io/quarkus/ts/startstop/utils/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public class Commands {
private static final Pattern numPattern = Pattern.compile("[ \t]*[0-9]+[ \t]*");
private static final Pattern quarkusVersionPattern = Pattern.compile("[ \t]*<quarkus.version>([^<]*)</quarkus.version>.*");
private static final Pattern trailingSlash = Pattern.compile("/+$");
private static final String QUARKUS_PLATFORM_GROUP_ID = "com.redhat.quarkus.platform";
private static final String QUARKUS_UPSTREAM_GROUP_ID = "io.quarkus.platform";
private static final String REDHAT_VERSION_TAG = "-redhat-";

public static String mvnw() {
return Commands.isThisWindows ? "mvnw.cmd" : "./mvnw";
Expand Down Expand Up @@ -149,6 +152,14 @@ public static String getQuarkusVersion() {
throw new IllegalArgumentException(failure);
}

public static String getQuarkusGroupId() {
if (getQuarkusVersion().contains(REDHAT_VERSION_TAG)) {
return QUARKUS_PLATFORM_GROUP_ID;
}

return QUARKUS_UPSTREAM_GROUP_ID;
}

public static String getBaseDir() {
String env = System.getenv().get("basedir");
String sys = System.getProperty("basedir");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.stream.Stream;

import static io.quarkus.ts.startstop.utils.Commands.getQuarkusGroupId;
import static io.quarkus.ts.startstop.utils.Commands.getQuarkusNativeProperties;
import static io.quarkus.ts.startstop.utils.Commands.getLocalMavenRepoDir;
import static io.quarkus.ts.startstop.utils.Commands.getQuarkusVersion;
Expand All @@ -25,7 +26,7 @@ public enum MvnCmds {
GENERATOR(new String[][]{
new String[]{
"mvn",
"io.quarkus.platform:quarkus-maven-plugin:" + getQuarkusVersion() + ":create",
getQuarkusGroupId() + ":quarkus-maven-plugin:" + getQuarkusVersion() + ":create",
"-DprojectGroupId=my-groupId",
"-DprojectArtifactId=" + Apps.GENERATED_SKELETON.dir,
"-DprojectVersion=1.0.0-SNAPSHOT",
Expand Down

0 comments on commit c682832

Please sign in to comment.