Skip to content

Commit

Permalink
Merge pull request #1126 from gsmet/quarkus-3.7.4
Browse files Browse the repository at this point in the history
Upgrade to Quarkus 3.7.4
  • Loading branch information
gsmet committed Feb 21, 2024
2 parents 20c293d + be6bb23 commit c45d630
Show file tree
Hide file tree
Showing 7 changed files with 1,200 additions and 1,193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ public void execute() throws MojoExecutionException {
}

askTheUserForMissingValues();
if (projectArtifactId != DEFAULT_ARTIFACT_ID && !OK_ID.matcher(projectArtifactId).matches()) {
if (!DEFAULT_ARTIFACT_ID.equals(projectArtifactId) && !OK_ID.matcher(projectArtifactId).matches()) {
throw new MojoExecutionException(String.format(BAD_IDENTIFIER, "artifactId", projectArtifactId));
}
if (projectGroupId != DEFAULT_GROUP_ID && !OK_ID.matcher(projectGroupId).matches()) {
if (!DEFAULT_GROUP_ID.equals(projectGroupId) && !OK_ID.matcher(projectGroupId).matches()) {
throw new MojoExecutionException(String.format(BAD_IDENTIFIER, "groupId", projectGroupId));
}

Expand Down Expand Up @@ -389,16 +389,7 @@ private void askTheUserForMissingValues() throws MojoExecutionException {
// If the user has disabled the interactive mode or if the user has specified the artifactId, disable the
// user interactions.
if (!session.getRequest().isInteractiveMode() || shouldUseDefaults()) {
if (isBlank(projectArtifactId)) {
// we need to set it for the project directory
projectArtifactId = DEFAULT_ARTIFACT_ID;
}
if (isBlank(projectGroupId)) {
projectGroupId = DEFAULT_GROUP_ID;
}
if (isBlank(projectVersion)) {
projectVersion = DEFAULT_VERSION;
}
setProperDefaults();
return;
}

Expand Down Expand Up @@ -427,12 +418,27 @@ private void askTheUserForMissingValues() throws MojoExecutionException {
input -> noCode = input.startsWith("n"));

prompter.collectInput();
} else {
setProperDefaults();
}
} catch (IOException e) {
throw new MojoExecutionException("Unable to get user input", e);
}
}

private void setProperDefaults() {
if (isBlank(projectArtifactId)) {
// we need to set it for the project directory
projectArtifactId = DEFAULT_ARTIFACT_ID;
}
if (isBlank(projectGroupId)) {
projectGroupId = DEFAULT_GROUP_ID;
}
if (isBlank(projectVersion)) {
projectVersion = DEFAULT_VERSION;
}
}

private boolean shouldUseDefaults() {
// Must be called before user input
return projectArtifactId != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ private String handleAutoCompile() throws MojoExecutionException {
if (!e.getGoals().isEmpty()) {
goalPrefix = getMojoDescriptor(p, e.getGoals().get(0)).getPluginDescriptor().getGoalPrefix();
pluginPrefixes.put(goalPrefix, p);
pluginPrefixes.put(p.getId(), p);
}
if (e.getPhase() != null) {
phaseExecutions.computeIfAbsent(e.getPhase(), k -> new ArrayList<>()).add(new PluginExec(p, goalPrefix, e));
Expand Down Expand Up @@ -630,7 +631,7 @@ private String handleAutoCompile() throws MojoExecutionException {
if (goal.endsWith(currentGoal)) {
break;
}
var colon = goal.indexOf(':');
var colon = goal.lastIndexOf(':');
if (colon >= 0) {
var plugin = pluginPrefixes.get(goal.substring(0, colon));
if (plugin == null) {
Expand Down
Loading

0 comments on commit c45d630

Please sign in to comment.