-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #17484 from essobedo/maven-build-thread-safe
Make the maven build task compatible with parallel builds
- Loading branch information
Showing
19 changed files
with
482 additions
and
24 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
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
95 changes: 95 additions & 0 deletions
95
...ration-tests/maven/src/test/resources/projects/multi-build-mode-parallel/module-1/pom.xml
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,95 @@ | ||
<?xml version="1.0"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<parent> | ||
<groupId>org.multi-build-mode-parallel</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>module-1</artifactId> | ||
<properties> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>${quarkus-plugin.version}</version> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<id>foo-1</id> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<properties> | ||
<quarkus.profile>foo-1</quarkus.profile> | ||
<quarkus.package.output-directory>foo-1-quarkus-app</quarkus.package.output-directory> | ||
</properties> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>bar-1</id> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
<configuration> | ||
<properties> | ||
<quarkus.profile>bar-1</quarkus.profile> | ||
<quarkus.package.output-directory>bar-1-quarkus-app</quarkus.package.output-directory> | ||
</properties> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>${surefire-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<id>test-foo</id> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
<configuration> | ||
<groups>foo</groups> | ||
<excludedGroups>others</excludedGroups> | ||
<skip>${maven.test.skip}</skip> | ||
<systemPropertyVariables> | ||
<quarkus.test.profile>foo-1</quarkus.test.profile> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>test-bar</id> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
<configuration> | ||
<groups>bar</groups> | ||
<excludedGroups>others</excludedGroups> | ||
<skip>${maven.test.skip}</skip> | ||
<systemPropertyVariables> | ||
<quarkus.test.profile>bar-1</quarkus.test.profile> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<excludedGroups>foo,bar</excludedGroups> | ||
</configuration> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
</project> |
19 changes: 19 additions & 0 deletions
19
.../projects/multi-build-mode-parallel/module-1/src/main/java/org/acme/HelloResourceBar.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,19 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.arc.profile.IfBuildProfile; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@IfBuildProfile("bar-1") | ||
@Path("/hello") | ||
public class HelloResourceBar { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "Hello bar 1"; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../projects/multi-build-mode-parallel/module-1/src/main/java/org/acme/HelloResourceFoo.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,19 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.arc.profile.IfBuildProfile; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@IfBuildProfile("foo-1") | ||
@Path("/hello") | ||
public class HelloResourceFoo { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "Hello foo 1"; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...jects/multi-build-mode-parallel/module-1/src/test/java/org/acme/HelloResourceBarTest.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,27 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@Tag("bar") | ||
@QuarkusTest | ||
public class HelloResourceBarTest { | ||
@Test | ||
void testHelloEndpoint() throws Exception { | ||
for (int i = 0; i < 5; i++) { | ||
if (i > 0) { | ||
Thread.sleep(1_000L); // Make it wait to cause build conflicts | ||
} | ||
given() | ||
.when().get("/hello") | ||
.then() | ||
.statusCode(200) | ||
.body(is("Hello bar 1")); | ||
|
||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...jects/multi-build-mode-parallel/module-1/src/test/java/org/acme/HelloResourceFooTest.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 org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@Tag("foo") | ||
@QuarkusTest | ||
public class HelloResourceFooTest { | ||
@Test | ||
void testHelloEndpoint() throws Exception { | ||
for (int i = 0; i < 5; i++) { | ||
if (i > 0) { | ||
Thread.sleep(1_000L); // Make it wait to cause build conflicts | ||
} | ||
given() | ||
.when().get("/hello") | ||
.then() | ||
.statusCode(200) | ||
.body(is("Hello foo 1")); | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ces/projects/multi-build-mode-parallel/module-1/src/test/resources/application.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 @@ | ||
quarkus.http.test-port=0 |
Oops, something went wrong.