Skip to content

Commit

Permalink
Merge pull request #27600 from aloubyansky/go-offline-thread-safe
Browse files Browse the repository at this point in the history
Mark quarkus:go-offline as threadSafe=true
  • Loading branch information
gsmet committed Aug 30, 2022
2 parents 25903a5 + 0ea21e1 commit 2201e69
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -4,7 +4,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.maven.plugin.AbstractMojo;
Expand All @@ -30,14 +29,13 @@
import io.quarkus.bootstrap.resolver.maven.workspace.LocalWorkspace;
import io.quarkus.bootstrap.util.IoUtils;
import io.quarkus.maven.dependency.ArtifactCoords;
import io.quarkus.maven.dependency.GACTV;
import io.quarkus.runtime.LaunchMode;

/**
* This goal downloads all the Maven artifact dependencies required to build, run, test and
* launch the application dev mode.
*/
@Mojo(name = "go-offline")
@Mojo(name = "go-offline", threadSafe = true)
public class GoOfflineMojo extends AbstractMojo {

@Parameter(defaultValue = "${project}", readonly = true, required = true)
Expand Down Expand Up @@ -66,15 +64,15 @@ public void execute() throws MojoExecutionException, MojoFailureException {
final MavenArtifactResolver resolver = getResolver();
final DependencyNode root;
try {
root = resolver.collectDependencies(pom, Collections.emptyList()).getRoot();
root = resolver.collectDependencies(pom, List.of()).getRoot();
} catch (Exception e) {
throw new MojoExecutionException("Failed to collect dependencies of " + pom, e);
}

final List<Path> createdDirs = new ArrayList<>();
try {
ensureResolvableModule(root, resolver.getMavenContext().getWorkspace(), createdDirs);
final ArtifactCoords appArtifact = new GACTV(pom.getGroupId(), pom.getArtifactId(), pom.getClassifier(),
final ArtifactCoords appArtifact = ArtifactCoords.of(pom.getGroupId(), pom.getArtifactId(), pom.getClassifier(),
pom.getExtension(), pom.getVersion());
resolveAppModel(resolver, appArtifact, LaunchMode.NORMAL);
resolveAppModel(resolver, appArtifact, LaunchMode.DEVELOPMENT);
Expand Down

0 comments on commit 2201e69

Please sign in to comment.