Skip to content

Commit

Permalink
Merge pull request #19462 from glefloch/fix/19386
Browse files Browse the repository at this point in the history
Make sure super-configuration are used for dependency resolution
  • Loading branch information
glefloch authored Aug 18, 2021
2 parents 77d652e + 00e979d commit 11a3604
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static Configuration duplicateConfiguration(Project project, Configuratio
configurationCopy.getDependencies().addAll(boms);

for (Configuration toDuplicate : toDuplicates) {
for (Dependency dependency : toDuplicate.getDependencies()) {
for (Dependency dependency : toDuplicate.getAllDependencies()) {
if (includedBuild(project, dependency.getName()) != null) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id 'java'
id 'io.quarkus'
}

group = 'com.quarkus.demo'
version = '1.0'

repositories {
mavenCentral()
if (System.properties.containsKey('maven.repo.local')) {
maven {
url System.properties.get('maven.repo.local')
}
} else {
mavenLocal()
}
}

dependencies {
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")

implementation 'io.quarkus:quarkus-resteasy'
testImplementation 'io.quarkus:quarkus-junit5'
testImplementation 'io.rest-assured:rest-assured'

implementation 'org.apache.commons:commons-collections4:4.4'
testImplementation 'org.apache.commons:commons-collections4::tests'
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pluginManagement {
repositories {
if (System.properties.containsKey('maven.repo.local')) {
maven {
url System.properties.get('maven.repo.local')
}
} else {
mavenLocal()
}
mavenCentral()
gradlePluginPortal()
}
//noinspection GroovyAssignabilityCheck
plugins {
id 'io.quarkus' version "${quarkusPluginVersion}"
}
}

rootProject.name = 'quarkus-configuration-inheritance'


Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.acme.quarkus.sample;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {

@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkus.gradle;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;

import org.junit.jupiter.api.Test;

public class DependencyResolutionTest extends QuarkusGradleWrapperTestBase {
@Test
public void shouldResolveDependencyVersionFromSuperConfigurationProject()
throws IOException, URISyntaxException, InterruptedException {
final File projectDir = getProjectDir("configuration-inheritance-project");

final BuildResult result = runGradleWrapper(projectDir, "clean", "quarkusBuild");

assertThat(result.getTasks().get(":quarkusBuild")).isEqualTo(BuildResult.SUCCESS_OUTCOME);
}
}

0 comments on commit 11a3604

Please sign in to comment.