martinburger opened a new issue, #128:
URL: https://github.com/apache/maven-archetypes/issues/128
### Affected version
1.5
### Bug description
# TL;DR
When creating a new project based on the Maven Quickstart Archetype and
setting the `junitVersion` to `6.0.1`, no JUnit dependencies are added to the
POM.
# Steps to reproduce
## Create project that is supposed to use JUnit 5
```shell
❯ mvn archetype:generate \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DarchetypeVersion=1.5 \
-DjavaCompilerVersion=21 \
-DjunitVersion=5.14.1 \
-DgroupId=issues \
-DartifactId=junit-version-5 \
-DinteractiveMode=false
```
## Create project that is supposed to use JUnit 6
```shell
❯ mvn archetype:generate \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DarchetypeVersion=1.5 \
-DjavaCompilerVersion=21 \
-DjunitVersion=6.0.1 \
-DgroupId=issues \
-DartifactId=junit-version-6 \
-DinteractiveMode=false
```
## Examine differences
```shell
❯ diff -u -r junit-version-5 junit-version-6
```
```diff
diff -u -r junit-version-5/pom.xml junit-version-6/pom.xml
--- junit-version-5/pom.xml 2025-11-21 18:28:21
+++ junit-version-6/pom.xml 2025-11-21 18:28:45
@@ -4,10 +4,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>issues</groupId>
- <artifactId>junit-version-5</artifactId>
+ <artifactId>junit-version-6</artifactId>
<version>1.0-SNAPSHOT</version>
- <name>junit-version-5</name>
+ <name>junit-version-6</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
@@ -16,31 +16,6 @@
<maven.compiler.release>21</maven.compiler.release>
</properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.junit</groupId>
- <artifactId>junit-bom</artifactId>
- <version>5.14.1</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependencies>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- Optionally: parameterized tests support -->
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-params</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven
defaults (may be moved to parent pom) -->
```
# Additional details
## Maven version
```shell
❯ mvn -version
Apache Maven 3.9.11 (3e54c93a704957b63ee3494413a2b544fd3d825b)
Maven home: /opt/homebrew/Cellar/maven/3.9.11/libexec
Java version: 25.0.1, vendor: Eclipse Adoptium, runtime:
/Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "15.7.2", arch: "aarch64", family: "mac"
```
## Java version
```shell
❯ java -version
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.1+8 (build 25.0.1+8-LTS, mixed mode,
sharing)
```
## `MAVEN_OPTS`
```shell
❯ echo $MAVEN_OPTS
--sun-misc-unsafe-memory-access=allow
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]