This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-site.git
commit 1d4eb71e58bd530c1d2e9e73c775fb2db5d29c3a Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Mon Nov 2 07:45:51 2026 +0000 Use JUnit 5 in the test examples and refresh the getting-started output --- content/markdown/guides/getting-started/index.md | 119 ++++++++++++----------- content/markdown/guides/mini/guide-mixins.md | 4 +- content/markdown/maven-jsr330.md | 6 +- content/markdown/pom.md | 8 +- 4 files changed, 72 insertions(+), 65 deletions(-) diff --git a/content/markdown/guides/getting-started/index.md b/content/markdown/guides/getting-started/index.md index 95656d36..1722b7f4 100644 --- a/content/markdown/guides/getting-started/index.md +++ b/content/markdown/guides/getting-started/index.md @@ -170,23 +170,24 @@ Upon executing this command you should see output like the following: ``` [INFO] Scanning for projects... +[INFO] Loaded 24323 auto-discovered prefixes for remote repository central (prefixes-central.txt) [INFO] [INFO] ----------------------< com.mycompany.app:my-app >---------------------- [INFO] Building my-app 1.0-SNAPSHOT +[INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] -[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ my-app --- -[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] --- resources:3.3.1:resources (default-resources) @ my-app --- [INFO] skip non existing resourceDirectory <dir>/my-app/src/main/resources [INFO] -[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ my-app --- -[INFO] Changes detected - recompiling the module! -[INFO] Compiling 1 source file to <dir>/my-app/target/classes +[INFO] --- compiler:3.13.0:compile (default-compile) @ my-app --- +[INFO] Recompiling the module because of changed source code. +[INFO] Compiling 1 source file with javac [debug release 17] to target/classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ -[INFO] Total time: 0.899 s -[INFO] Finished at: 2020-07-12T11:31:54+01:00 +[INFO] Total time: 4.709 s +[INFO] Finished at: 2026-11-02T07:42:13Z [INFO] ------------------------------------------------------------------------ ``` @@ -210,33 +211,34 @@ Upon executing this command you should see output like the following: ``` [INFO] Scanning for projects... +[INFO] Loaded 24323 auto-discovered prefixes for remote repository central (prefixes-central.txt) [INFO] [INFO] ----------------------< com.mycompany.app:my-app >---------------------- [INFO] Building my-app 1.0-SNAPSHOT +[INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] -[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ my-app --- -[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] --- resources:3.3.1:resources (default-resources) @ my-app --- [INFO] skip non existing resourceDirectory <dir>/my-app/src/main/resources [INFO] -[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ my-app --- -[INFO] Nothing to compile - all classes are up to date +[INFO] --- compiler:3.13.0:compile (default-compile) @ my-app --- +[INFO] Nothing to compile - all classes are up to date. [INFO] -[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ my-app --- -[INFO] Using 'UTF-8' encoding to copy filtered resources. +[INFO] --- resources:3.3.1:testResources (default-testResources) @ my-app --- [INFO] skip non existing resourceDirectory <dir>/my-app/src/test/resources [INFO] -[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ my-app --- -[INFO] Changes detected - recompiling the module! -[INFO] Compiling 1 source file to <dir>/my-app/target/test-classes +[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ my-app --- +[INFO] Recompiling the module because of changed source code. +[INFO] Compiling 1 source file with javac [debug release 17] to target/test-classes [INFO] -[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ my-app --- +[INFO] --- surefire:3.3.0:test (default-test) @ my-app --- +[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.mycompany.app.AppTest -[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in com.mycompany.app.AppTest +[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.148 s -- in com.mycompany.app.AppTest [INFO] [INFO] Results: [INFO] @@ -245,8 +247,8 @@ Upon executing this command you should see output like the following: [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ -[INFO] Total time: 1.881 s -[INFO] Finished at: 2020-07-12T12:00:33+01:00 +[INFO] Total time: 6.854 s +[INFO] Finished at: 2026-11-02T07:42:24Z [INFO] ------------------------------------------------------------------------ ``` @@ -285,45 +287,50 @@ Upon executing this command you should see the following output: ``` [INFO] Scanning for projects... +[INFO] Loaded 24323 auto-discovered prefixes for remote repository central (prefixes-central.txt) [INFO] [INFO] ----------------------< com.mycompany.app:my-app >---------------------- [INFO] Building my-app 1.0-SNAPSHOT +[INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] -[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ my-app --- -... -[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ my-app --- -[INFO] Nothing to compile - all classes are up to date +[INFO] --- resources:3.3.1:resources (default-resources) @ my-app --- +[INFO] skip non existing resourceDirectory <dir>/my-app/src/main/resources [INFO] -[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ my-app --- -... -[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ my-app --- -[INFO] Nothing to compile - all classes are up to date +[INFO] --- compiler:3.13.0:compile (default-compile) @ my-app --- +[INFO] Nothing to compile - all classes are up to date. +[INFO] +[INFO] --- resources:3.3.1:testResources (default-testResources) @ my-app --- +[INFO] skip non existing resourceDirectory <dir>/my-app/src/test/resources +[INFO] +[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ my-app --- +[INFO] Nothing to compile - all classes are up to date. [INFO] -[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ my-app --- +[INFO] --- surefire:3.3.0:test (default-test) @ my-app --- +[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.mycompany.app.AppTest -[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 s - in com.mycompany.app.AppTest +[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.176 s -- in com.mycompany.app.AppTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] -[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ my-app --- +[INFO] --- jar:3.4.2:jar (default-jar) @ my-app --- [INFO] Building jar: <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar [INFO] -[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ my-app --- -[INFO] Installing <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar to <local-repository>/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.jar +[INFO] --- install:3.1.2:install (default-install) @ my-app --- [INFO] Installing <dir>/my-app/pom.xml to <local-repository>/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.pom +[INFO] Installing <dir>/my-app/target/my-app-1.0-SNAPSHOT.jar to <local-repository>/com/mycompany/app/my-app/1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ -[INFO] Total time: 1.678 s -[INFO] Finished at: 2020-07-12T12:04:45+01:00 +[INFO] Total time: 7.034 s +[INFO] Finished at: 2026-11-02T07:42:36Z [INFO] ------------------------------------------------------------------------ ``` @@ -519,9 +526,9 @@ To have Maven filter resources when copying, simply set `filtering` to true for <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> @@ -587,9 +594,9 @@ Next, we'll add a reference to this new file in the `pom.xml`: <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> @@ -634,9 +641,9 @@ the next execution of the `mvn process-resources` command will put our new prope <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> @@ -691,9 +698,9 @@ The `dependencies` section of the `pom.xml` lists all of the external dependenci <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> @@ -770,9 +777,9 @@ Now that we know the information we need, we can add the dependency to our pom.x <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> <dependency> @@ -810,9 +817,9 @@ Here is an example using scp and username/password authentication: <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> <dependency> @@ -909,9 +916,9 @@ Note that these must all be on a single line. This will create a directory calle <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.11</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> diff --git a/content/markdown/guides/mini/guide-mixins.md b/content/markdown/guides/mini/guide-mixins.md index 2def3f92..50fe21dc 100644 --- a/content/markdown/guides/mini/guide-mixins.md +++ b/content/markdown/guides/mini/guide-mixins.md @@ -298,7 +298,7 @@ Standardize testing configurations: <packaging>pom</packaging> <properties> - <junit.version>5.9.2</junit.version> + <junit.version>5.11.0</junit.version> <mockito.version>5.1.1</mockito.version> </properties> @@ -431,7 +431,7 @@ company-maven-mixins/ <properties> <maven.compiler.source>17</maven.compiler.source> <spring-boot.version>3.1.0</spring-boot.version> - <junit.version>5.9.2</junit.version> + <junit.version>5.11.0</junit.version> </properties> <!-- All dependencies and plugins --> diff --git a/content/markdown/maven-jsr330.md b/content/markdown/maven-jsr330.md index 180c9260..8fbb3618 100644 --- a/content/markdown/maven-jsr330.md +++ b/content/markdown/maven-jsr330.md @@ -107,9 +107,9 @@ In addition, we add classical Maven plugin dependencies <scope>provided</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.1</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <scope>test</scope> </dependency> </dependencies> diff --git a/content/markdown/pom.md b/content/markdown/pom.md index b04da4b6..30b323aa 100644 --- a/content/markdown/pom.md +++ b/content/markdown/pom.md @@ -190,9 +190,9 @@ allowing your list to focus solely on the dependencies your project requires. ... <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.11.0</version> <type>jar</type> <scope>test</scope> <optional>true</optional> @@ -722,7 +722,7 @@ child POMs and transitive dependencies. One of those elements is `<dependencyManagement>`. `<dependencyManagement>` is used by a POM to help manage dependency information across all of its children. -If the `my-parent` project uses `dependencyManagement` to define a dependency on `junit:junit:4.12`, then POMs inheriting from this one can set their dependency giving the `groupId`=`junit` and `artifactId`=`junit` only and Maven will fill in the `version` set by the parent. +If the `my-parent` project uses `dependencyManagement` to define a dependency on `org.junit.jupiter:junit-jupiter:5.11.0`, then POMs inheriting from this one can set their dependency giving the `groupId`=`org.junit.jupiter` and `artifactId`=`junit-jupiter` only and Maven will fill in the `version` set by the parent. The benefits of this method are obvious. Dependency details can be set in one central location, which propagates to all inheriting POMs.
