Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark quarkus:go-offline as threadSafe=true #27600

Merged
merged 1 commit into from Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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