Skip to content

Commit

Permalink
Merge pull request #17473 from aloubyansky/quarkusDeploymentOnlyClass…
Browse files Browse the repository at this point in the history
…path

Gradle: create quarkusDeploymentOnlyClasspath configuration
  • Loading branch information
glefloch authored May 27, 2021
2 parents 3ff1975 + d7e8da7 commit 57dad8b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions core/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<groupId>org.aesh</groupId>
<artifactId>readline</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

public class QuarkusModelBuilder implements ParameterizedToolingModelBuilder<ModelParameter> {

private static final String QUARKUS_DEPLOYMENT_ONLY_CLASSPATH = "quarkusDeploymentOnlyClasspath";
private static final String MAIN_RESOURCES_OUTPUT = "build/resources/main";
private static final String CLASSES_OUTPUT = "build/classes";

Expand Down Expand Up @@ -291,8 +292,13 @@ private List<Dependency> collectExtensionDependencies(Project project,
Collection<org.gradle.api.artifacts.Dependency> extensions) {
final List<Dependency> platformDependencies = new LinkedList<>();

final Configuration deploymentConfig = project.getConfigurations()
.detachedConfiguration(extensions.toArray(new org.gradle.api.artifacts.Dependency[0]));
Configuration deploymentConfig = project.getConfigurations().findByName(QUARKUS_DEPLOYMENT_ONLY_CLASSPATH);
if (deploymentConfig == null) {
deploymentConfig = project.getConfigurations().create(QUARKUS_DEPLOYMENT_ONLY_CLASSPATH)
.defaultDependencies(a -> {
a.addAll(extensions);
});
}
final ResolvedConfiguration rc = deploymentConfig.getResolvedConfiguration();
for (ResolvedArtifact a : rc.getResolvedArtifacts()) {
if (!isDependency(a)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ repositories {

dependencies {
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
implementation 'io.quarkus:quarkus-resteasy'

// Library-2 has to be dependency as implementation and test fixture
implementation(project(':library-2'))
Expand Down

0 comments on commit 57dad8b

Please sign in to comment.