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#44032 from cdsap/avoid_forced_resolution…
…_when_configuring_task Avoiding forcing resolution when configuring QuarkusApplicationModelTask
- Loading branch information
Showing
12 changed files
with
154 additions
and
6 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
31 changes: 31 additions & 0 deletions
31
...ts/gradle/src/main/resources/java-platform-with-eager-resolution-project/build.gradle.kts
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,31 @@ | ||
plugins { | ||
java | ||
id("io.quarkus") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
|
||
dependencies { | ||
implementation("io.quarkus:quarkus-rest") | ||
implementation("io.quarkus:quarkus-arc") | ||
implementation(enforcedPlatform(project(":library"))) | ||
testImplementation("io.quarkus:quarkus-junit5") | ||
testImplementation("io.rest-assured:rest-assured") | ||
} | ||
|
||
group = "org.acme" | ||
version = "1.0.0-SNAPSHOT" | ||
|
||
tasks.withType<Test> { | ||
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager") | ||
} | ||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add("-parameters") | ||
} | ||
|
||
tasks.all{} |
3 changes: 3 additions & 0 deletions
3
...s/gradle/src/main/resources/java-platform-with-eager-resolution-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,3 @@ | ||
quarkusPlatformArtifactId=quarkus-bom | ||
quarkusPlatformGroupId=io.quarkus | ||
kotlinVersion=${kotlin.version} |
15 changes: 15 additions & 0 deletions
15
...e/src/main/resources/java-platform-with-eager-resolution-project/library/build.gradle.kts
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,15 @@ | ||
plugins { | ||
`java-platform` | ||
} | ||
|
||
val quarkusPlatformGroupId: String by project | ||
val quarkusPlatformArtifactId: String by project | ||
val quarkusPlatformVersion: String by project | ||
|
||
javaPlatform.allowDependencies() | ||
dependencies{ | ||
api(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")) | ||
constraints{ | ||
api("org.assertj:assertj-core:3.26.3") | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...sts/gradle/src/main/resources/java-platform-with-eager-resolution-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,19 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenLocal { | ||
content { | ||
includeGroupByRegex 'io.quarkus.*' | ||
includeGroup 'org.hibernate.orm' | ||
} | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
plugins { | ||
id 'io.quarkus' version "${quarkusPluginVersion}" | ||
id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}" | ||
id 'org.jetbrains.kotlin.plugin.allopen' version "${kotlinVersion}" | ||
} | ||
} | ||
rootProject.name='java-platform-with-eager-resolution-project' | ||
include(":library") |
16 changes: 16 additions & 0 deletions
16
.../java-platform-with-eager-resolution-project/src/main/java/org/acme/GreetingResource.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 jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
@Path("/hello") | ||
public class GreetingResource { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "Hello from Quarkus REST"; | ||
} | ||
} |
Empty file.
8 changes: 8 additions & 0 deletions
8
...tform-with-eager-resolution-project/src/native-test/java/org/acme/GreetingResourceIT.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,8 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
class GreetingResourceIT extends GreetingResourceTest { | ||
// Execute the same tests but in packaged mode. | ||
} |
20 changes: 20 additions & 0 deletions
20
...a-platform-with-eager-resolution-project/src/test/java/org/acme/GreetingResourceTest.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,20 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@QuarkusTest | ||
class GreetingResourceTest { | ||
@Test | ||
void testHelloEndpoint() { | ||
given() | ||
.when().get("/hello") | ||
.then() | ||
.statusCode(200) | ||
.body(is("Hello from Quarkus REST")); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...ion-tests/gradle/src/test/java/io/quarkus/gradle/JavaPlatformWithEagerResolutionTest.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,26 @@ | ||
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 java.nio.file.Path; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class JavaPlatformWithEagerResolutionTest extends QuarkusGradleWrapperTestBase { | ||
|
||
@Test | ||
public void shouldImportConditionalDependency() throws IOException, URISyntaxException, InterruptedException { | ||
|
||
final File projectDir = getProjectDir("java-platform-with-eager-resolution-project"); | ||
|
||
runGradleWrapper(projectDir, "clean", ":quarkusBuild"); | ||
|
||
final File buildDir = new File(projectDir, "build"); | ||
|
||
final Path quarkusOutput = buildDir.toPath().resolve("quarkus-app"); | ||
assertThat(quarkusOutput.resolve("quarkus-run.jar")).exists(); | ||
} | ||
} |