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

Add List<Dependency> forcedDependencies(LaunchMode) to the QuarkusBootstrapMojo #23266

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.maven;

import java.io.File;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +22,7 @@

import io.quarkus.bootstrap.app.CuratedApplication;
import io.quarkus.maven.dependency.ArtifactKey;
import io.quarkus.maven.dependency.Dependency;
import io.quarkus.runtime.LaunchMode;

public abstract class QuarkusBootstrapMojo extends AbstractMojo {
Expand Down Expand Up @@ -150,6 +152,17 @@ protected String appArtifactCoords() {
return appArtifact;
}

/**
* Allows implementations to provide extra dependencies that should be enforced on the application.
* Originally requested by Camel K.
*
* @param mode launch mode the application is being bootstrapped in
* @return list of extra dependencies that should be enforced on the application
*/
protected List<Dependency> forcedDependencies(LaunchMode mode) {
return Collections.emptyList();
}

protected RepositorySystem repositorySystem() {
return bootstrapProvider.repositorySystem();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ protected CuratedApplication doBootstrap(QuarkusBootstrapMojo mojo, LaunchMode m
.setBuildSystemProperties(effectiveProperties)
.setProjectRoot(mojo.baseDir().toPath())
.setBaseName(mojo.finalName())
.setTargetDirectory(mojo.buildDir().toPath());
.setTargetDirectory(mojo.buildDir().toPath())
.setForcedDependencies(mojo.forcedDependencies(mode));

try {
return builder.build().bootstrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public static class Builder {
boolean isolateDeployment;
MavenArtifactResolver mavenArtifactResolver;
ArtifactCoords managingProject;
List<Dependency> forcedDependencies = new ArrayList<>();
List<Dependency> forcedDependencies = Collections.emptyList();
boolean disableClasspathCache;
ApplicationModel existingModel;
final Set<ArtifactKey> localArtifacts = new HashSet<>();
Expand Down