forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#19151 from asodja/spring-dependency-plugin
- Loading branch information
Showing
9 changed files
with
134 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
integration-tests/gradle/src/main/resources/spring-dependency-plugin-project/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
plugins { | ||
id 'java' | ||
id 'io.quarkus' | ||
id 'io.spring.dependency-management' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
if (System.properties.containsKey('maven.repo.local')) { | ||
maven { | ||
url System.properties.get('maven.repo.local') | ||
} | ||
} else { | ||
mavenLocal() | ||
} | ||
} | ||
|
||
dependencyManagement { | ||
dependencies { | ||
dependency "io.quarkus:quarkus-resteasy:${quarkusPlatformVersion}" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") { | ||
// We exclude resteasy so Spring dependency management handles it | ||
exclude group: 'io.quarkus', module: 'quarkus-resteasy' | ||
} | ||
implementation "io.quarkus:quarkus-resteasy" | ||
} | ||
|
||
compileJava { | ||
options.compilerArgs << '-parameters' | ||
} |
2 changes: 2 additions & 0 deletions
2
...ration-tests/gradle/src/main/resources/spring-dependency-plugin-project/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
quarkusPlatformArtifactId=quarkus-bom | ||
quarkusPlatformGroupId=io.quarkus |
18 changes: 18 additions & 0 deletions
18
integration-tests/gradle/src/main/resources/spring-dependency-plugin-project/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pluginManagement { | ||
repositories { | ||
if (System.properties.containsKey('maven.repo.local')) { | ||
maven { | ||
url System.properties.get('maven.repo.local') | ||
} | ||
} else { | ||
mavenLocal() | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
plugins { | ||
id 'io.quarkus' version "${quarkusPluginVersion}" | ||
id 'io.spring.dependency-management' version '1.0.11.RELEASE' | ||
} | ||
} | ||
rootProject.name='code-with-quarkus' |
16 changes: 16 additions & 0 deletions
16
...in/resources/spring-dependency-plugin-project/src/main/java/org/acme/ExampleResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.acme; | ||
|
||
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 ExampleResource { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
integration-tests/gradle/src/test/java/io/quarkus/gradle/SpringDependencyManagementTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 SpringDependencyManagementTest extends QuarkusGradleWrapperTestBase { | ||
|
||
@Test | ||
public void testQuarkusBuildShouldWorkWithSpringDependencyManagement() | ||
throws IOException, URISyntaxException, InterruptedException { | ||
final File projectDir = getProjectDir("spring-dependency-plugin-project"); | ||
|
||
final BuildResult result = runGradleWrapper(projectDir, "clean", "quarkusBuild"); | ||
|
||
assertThat(result.getTasks().get(":quarkusBuild")).isEqualTo(BuildResult.SUCCESS_OUTCOME); | ||
} | ||
} |