Skip to content

Commit 5a41c2f

Browse files
committed
Dev mode test for a project dependency with a custom classifier quarkusio#48100
1 parent bc13138 commit 5a41c2f

File tree

9 files changed

+135
-0
lines changed

9 files changed

+135
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
quarkusPluginId=io.quarkus
2+
quarkusPlatformGroupId=io.quarkus
3+
quarkusPlatformArtifactId=quarkus-bom
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
group 'io.example'
6+
version '1.0-SNAPSHOT'
7+
8+
dependencies {
9+
implementation project(':project-b')
10+
}
11+
12+
jar {
13+
archiveClassifier = "something"
14+
archiveBaseName = "project-a"
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package io.blob;
2+
3+
import io.leaf.SomeCLass;
4+
5+
public class Intermediate {
6+
7+
public void someMethod() {
8+
SomeCLass someClass = new SomeCLass();
9+
someClass.doWork();
10+
}
11+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
group 'io.example'
6+
version '1.0-SNAPSHOT'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package io.leaf;
2+
3+
public class SomeCLass {
4+
public void doWork() {
5+
System.out.println("Doing work in SomeClass");
6+
}
7+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
id 'java'
3+
id 'io.quarkus'
4+
}
5+
6+
repositories {
7+
mavenCentral()
8+
mavenLocal()
9+
}
10+
11+
dependencies {
12+
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
13+
implementation 'io.quarkus:quarkus-rest'
14+
implementation 'io.quarkus:quarkus-arc'
15+
implementation project(':project-a')
16+
testImplementation 'io.quarkus:quarkus-junit5'
17+
testImplementation 'io.rest-assured:rest-assured'
18+
}
19+
20+
group 'io.example'
21+
version '1.0-SNAPSHOT'
22+
23+
test {
24+
systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
25+
}
26+
compileJava {
27+
options.encoding = 'UTF-8'
28+
options.compilerArgs << '-parameters'
29+
}
30+
31+
compileTestJava {
32+
options.encoding = 'UTF-8'
33+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.example;
2+
3+
import io.blob.Intermediate;
4+
import jakarta.ws.rs.GET;
5+
import jakarta.ws.rs.Path;
6+
import jakarta.ws.rs.Produces;
7+
import jakarta.ws.rs.core.MediaType;
8+
9+
@Path("/hello")
10+
public class ExampleResource {
11+
12+
@GET
13+
@Produces(MediaType.TEXT_PLAIN)
14+
public String hello() {
15+
Intermediate intermediate = new Intermediate();
16+
intermediate.someMethod();
17+
return "Hello from Quarkus REST";
18+
}
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pluginManagement {
2+
repositories {
3+
mavenLocal {
4+
content {
5+
includeGroupByRegex 'io.quarkus.*'
6+
includeGroup 'org.hibernate.orm'
7+
}
8+
}
9+
mavenCentral()
10+
gradlePluginPortal()
11+
}
12+
//noinspection GroovyAssignabilityCheck
13+
plugins {
14+
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
15+
}
16+
}
17+
rootProject.name='quarkus-jar-issue'
18+
19+
include 'runner'
20+
include 'project-a'
21+
include 'project-b'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package io.quarkus.gradle.devmode;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
public class CustomJarClassifierDevModeTest extends QuarkusDevGradleTestBase {
6+
7+
@Override
8+
protected String projectDirectoryName() {
9+
return "custom-jar-classifier-dependency";
10+
}
11+
12+
@Override
13+
protected String[] buildArguments() {
14+
return new String[] { "clean", "quarkusDev" };
15+
}
16+
17+
protected void testDevMode() throws Exception {
18+
assertThat(getHttpResponse("/hello")).contains("Hello from Quarkus REST");
19+
}
20+
}

0 commit comments

Comments
 (0)