-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set junit
as Automatic-Module-Name
in standalone JAR
#4079
Comments
With Index: junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts
--- a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts (revision 35d3dd71662beda795e3ce3c428b9a1215d8c9e4)
+++ b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts (date 1729247166506)
@@ -25,6 +25,7 @@
tasks {
jar {
manifest {
+ attributes("Automatic-Module-Name" to "junit")
attributes("Main-Class" to "org.junit.platform.console.ConsoleLauncher")
}
}
applied, we'd get for
|
https://github.com/junit-team/junit4/blob/ed47b7f487bafa48cff47f051af81a004cd36049/pom.xml#L361 |
Are you thinking about name clashes in cases where both artifacts ( |
Yes, which happens as soon as one uses the Vintage engine. Moreover, it "feels wrong". |
I agree with Marc. We should not use
|
@sormuras Ok to close this? |
Yes. |
Please assign a status label to this issue. |
Running
jar --describe-module --file junit-platform-console-standalone-X.Y.Z.jar
yields:The name of the derived automatic module is based on the file name - which is unstable if users or build tools rename the JAR file. It would be better to provide a stable name in the JAR's manifest for when the standalone JAR is put on the module path. As this JUnit Platform standalone JAR is often used as a drop-in replacment for JUnit 3/4, the automatic module name should be
junit
- just as thejunit.jar
has it since 2018 via:Automatic-Module-Name
junit4#1571The text was updated successfully, but these errors were encountered: