Repository: junit-team/junit5 (language: java)

Issue:
Remove `native-image.properties` files from published JARs
The [re-implementation of the JUnit feature](https://github.com/graalvm/native-build-tools/pull/693) in native-build-tools makes including these options obsolete and even can even break the feature.

## Deliverables

- [x] Remove `native-image.properties` from all JARs



Discussion / hints:

Fix patch:
diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.0-M3.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.0-M3.adoc
index 533bee62be63..0c9907c5208d 100644
--- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.0-M3.adoc
+++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.13.0-M3.adoc
@@ -10,6 +10,19 @@ link:{junit5-repo}+/milestone/93?closed=1+[5.13.0-M3] milestone page in the JUni
 repository on GitHub.
 
 
+[[release-notes-5.13.0-M3-overall-improvements]]
+=== Overall Changes
+
+[[release-notes-5.13.0-M3-overall-new-features-and-improvements]]
+==== Deprecations and Breaking Changes
+
+* The JUnit feature in GraalVM Native Build Tools has been rewritten to no longer require
+  JUnit classes to be initialized at build time. Therefore, JUnit's JARs no longer ship
+  with `native-image.properties` files that contain `--initialize-at-build-time` options
+  (introduced in 5.12.0). Please update to the most recent version of GraalVM Native Build
+  Tools prior to upgrading to this version of JUnit.
+
+
 [[release-notes-5.13.0-M3-junit-platform]]
 === JUnit Platform
 
diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.native-image-properties.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.native-image-properties.gradle.kts
deleted file mode 100644
index 262535f2083a..000000000000
--- a/gradle/plugins/common/src/main/kotlin/junitbuild.native-image-properties.gradle.kts
+++ /dev/null
@@ -1,55 +0,0 @@
-import junitbuild.graalvm.NativeImagePropertiesExtension
-import java.util.zip.ZipFile
-
-plugins {
-	`java-library`
-}
-
-val extension = extensions.create<NativeImagePropertiesExtension>("nativeImageProperties").apply {
-	val resourceFile: RegularFile = layout.projectDirectory.file("src/nativeImage/initialize-at-build-time")
-	if (resourceFile.asFile.exists()) {
-		initializeAtBuildTime.convention(providers.fileContents(resourceFile).asText.map { it.trim().lines() })
-	} else {
-		initializeAtBuildTime.empty()
-	}
-	initializeAtBuildTime.finalizeValueOnRead()
-}
-
-val outputDir = layout.buildDirectory.dir("resources/nativeImage")
-
-val propertyFileTask = tasks.register<WriteProperties>("nativeImageProperties") {
-	destinationFile = outputDir.map { it.file("META-INF/native-image/${project.group}/${project.name}/native-image.properties") }
-	// see https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/#configuration-file-format
-	property("Args", extension.initializeAtBuildTime.map {
-		if (it.isEmpty()) {
-			""
-		} else {
-			"--initialize-at-build-time=${it.joinToString(",")}"
-		}
-	})
-}
-
-val validationTask = tasks.register("validateNativeImageProperties") {
-	dependsOn(tasks.jar)
-	doLast {
-		val zipEntries = ZipFile(tasks.jar.get().archiveFile.get().asFile).use { zipFile ->
-			zipFile.entries().asSequence().map { it.name }.filter { it.endsWith(".class") }.toSet()
-		}
-		val missingClasses = extension.initializeAtBuildTime.get().filter { className ->
-			!zipEntries.contains("${className.replace('.', '/')}.class")
-		}
-		if (missingClasses.isNotEmpty()) {
-			throw GradleException("The following classes were specified as initialize-at-build-time but do not exist (you should probably remove them from nativeImageProperties.initializeAtBuildTime):\n${missingClasses.joinToString("\n- ", "- ")}")
-		}
-	}
-}
-
-tasks.check {
-	dependsOn(validationTask)
-}
-
-sourceSets {
-	main {
-		output.dir(propertyFileTask.map { outputDir })
-	}
-}
diff --git a/junit-jupiter-api/junit-jupiter-api.gradle.kts b/junit-jupiter-api/junit-jupiter-api.gradle.kts
index 378fc86a3d5d..402b5323eb57 100644
--- a/junit-jupiter-api/junit-jupiter-api.gradle.kts
+++ b/junit-jupiter-api/junit-jupiter-api.gradle.kts
@@ -1,7 +1,6 @@
 plugins {
 	id("junitbuild.kotlin-library-conventions")
 	id("junitbuild.code-generator")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-jupiter-api/src/nativeImage/initialize-at-build-time b/junit-jupiter-api/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 4c8cefb3747a..000000000000
--- a/junit-jupiter-api/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,5 +0,0 @@
-org.junit.jupiter.api.DisplayNameGenerator$IndicativeSentences
-org.junit.jupiter.api.DisplayNameGenerator$Standard
-org.junit.jupiter.api.TestInstance$Lifecycle
-org.junit.jupiter.api.condition.OS
-org.junit.jupiter.api.extension.ConditionEvaluationResult
diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
index 819993462c0e..04d86e5f0da7 100644
--- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
+++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts
@@ -1,6 +1,5 @@
 plugins {
 	id("junitbuild.kotlin-library-conventions")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-jupiter-engine/src/nativeImage/initialize-at-build-time b/junit-jupiter-engine/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index c62bba6bcda9..000000000000
--- a/junit-jupiter-engine/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,30 +0,0 @@
-org.junit.jupiter.engine.JupiterTestEngine
-org.junit.jupiter.engine.config.CachingJupiterConfiguration
-org.junit.jupiter.engine.config.DefaultJupiterConfiguration
-org.junit.jupiter.engine.config.EnumConfigurationParameterConverter
-org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter
-org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor
-org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor
-org.junit.jupiter.engine.descriptor.ClassTestDescriptor
-org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
-org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$ClassInfo
-org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor$LifecycleMethods
-org.junit.jupiter.engine.descriptor.DynamicDescendantFilter
-org.junit.jupiter.engine.descriptor.DynamicDescendantFilter$Mode
-org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector$1
-org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor
-org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
-org.junit.jupiter.engine.descriptor.JupiterTestDescriptor$1
-org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
-org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor$MethodInfo
-org.junit.jupiter.engine.descriptor.NestedClassTestDescriptor
-org.junit.jupiter.engine.descriptor.TestFactoryTestDescriptor
-org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor
-org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor
-org.junit.jupiter.engine.discovery.ClassSelectorResolver
-org.junit.jupiter.engine.discovery.ClassSelectorResolver$DummyClassTemplateInvocationContext
-org.junit.jupiter.engine.execution.ConditionEvaluator
-org.junit.jupiter.engine.execution.InterceptingExecutableInvoker
-org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall
-org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall$VoidMethodInterceptorCall
-org.junit.jupiter.engine.execution.InvocationInterceptorChain
diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts
index 0eef4adb7299..80ade03f4b27 100644
--- a/junit-jupiter-params/junit-jupiter-params.gradle.kts
+++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts
@@ -2,7 +2,6 @@ plugins {
 	id("junitbuild.kotlin-library-conventions")
 	id("junitbuild.shadow-conventions")
 	id("junitbuild.jmh-conventions")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-jupiter-params/src/nativeImage/initialize-at-build-time b/junit-jupiter-params/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 44ca7ffbd8ad..000000000000
--- a/junit-jupiter-params/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,2 +0,0 @@
-org.junit.jupiter.params.provider.EnumSource$Mode
-org.junit.jupiter.params.provider.EnumSource$Mode$Validator
diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts
index 3de45a7edfee..3465b0078020 100644
--- a/junit-platform-commons/junit-platform-commons.gradle.kts
+++ b/junit-platform-commons/junit-platform-commons.gradle.kts
@@ -3,7 +3,6 @@ import junitbuild.java.UpdateJarAction
 plugins {
 	id("junitbuild.java-library-conventions")
 	id("junitbuild.java-multi-release-sources")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-platform-commons/src/nativeImage/initialize-at-build-time b/junit-platform-commons/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index a6c384232123..000000000000
--- a/junit-platform-commons/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,5 +0,0 @@
-org.junit.platform.commons.util.StringUtils
-org.junit.platform.commons.logging.LoggerFactory$DelegatingLogger
-org.junit.platform.commons.logging.LoggerFactory
-org.junit.platform.commons.util.ReflectionUtils
-org.junit.platform.commons.util.LruCache
diff --git a/junit-platform-engine/junit-platform-engine.gradle.kts b/junit-platform-engine/junit-platform-engine.gradle.kts
index ef73763146a5..416b227b00c1 100644
--- a/junit-platform-engine/junit-platform-engine.gradle.kts
+++ b/junit-platform-engine/junit-platform-engine.gradle.kts
@@ -1,6 +1,5 @@
 plugins {
 	id("junitbuild.java-library-conventions")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-platform-engine/src/nativeImage/initialize-at-build-time b/junit-platform-engine/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 91032efba6c5..000000000000
--- a/junit-platform-engine/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,9 +0,0 @@
-org.junit.platform.engine.TestDescriptor$Type
-org.junit.platform.engine.UniqueId
-org.junit.platform.engine.UniqueId$Segment
-org.junit.platform.engine.UniqueIdFormat
-org.junit.platform.engine.support.descriptor.ClassSource
-org.junit.platform.engine.support.descriptor.MethodSource
-org.junit.platform.engine.support.hierarchical.Node$ExecutionMode
-org.junit.platform.engine.support.store.NamespacedHierarchicalStore
-org.junit.platform.engine.support.store.NamespacedHierarchicalStore$EvaluatedValue
diff --git a/junit-platform-launcher/junit-platform-launcher.gradle.kts b/junit-platform-launcher/junit-platform-launcher.gradle.kts
index acda6a79436f..a9b3630762c8 100644
--- a/junit-platform-launcher/junit-platform-launcher.gradle.kts
+++ b/junit-platform-launcher/junit-platform-launcher.gradle.kts
@@ -1,6 +1,5 @@
 plugins {
 	id("junitbuild.java-library-conventions")
-	id("junitbuild.native-image-properties")
 	`java-test-fixtures`
 }
 
diff --git a/junit-platform-launcher/src/nativeImage/initialize-at-build-time b/junit-platform-launcher/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 66e181d6e90d..000000000000
--- a/junit-platform-launcher/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,21 +0,0 @@
-org.junit.platform.launcher.LauncherSessionListener$1
-org.junit.platform.launcher.TestIdentifier
-org.junit.platform.launcher.core.DefaultLauncher
-org.junit.platform.launcher.core.DefaultLauncherConfig
-org.junit.platform.launcher.core.DiscoveryIssueNotifier
-org.junit.platform.launcher.core.EngineDiscoveryOrchestrator
-org.junit.platform.launcher.core.EngineExecutionOrchestrator
-org.junit.platform.launcher.core.HierarchicalOutputDirectoryProvider
-org.junit.platform.launcher.core.InternalTestPlan
-org.junit.platform.launcher.core.LauncherConfig
-org.junit.platform.launcher.core.LauncherConfigurationParameters
-org.junit.platform.launcher.core.LauncherConfigurationParameters$ParameterProvider$1
-org.junit.platform.launcher.core.LauncherConfigurationParameters$ParameterProvider$2
-org.junit.platform.launcher.core.LauncherConfigurationParameters$ParameterProvider$3
-org.junit.platform.launcher.core.LauncherConfigurationParameters$ParameterProvider$4
-org.junit.platform.launcher.core.LauncherDiscoveryResult
-org.junit.platform.launcher.core.LauncherDiscoveryResult$EngineResultInfo
-org.junit.platform.launcher.core.LauncherListenerRegistry
-org.junit.platform.launcher.core.ListenerRegistry
-org.junit.platform.launcher.core.SessionPerRequestLauncher
-org.junit.platform.launcher.listeners.UniqueIdTrackingListener
diff --git a/junit-platform-reporting/junit-platform-reporting.gradle.kts b/junit-platform-reporting/junit-platform-reporting.gradle.kts
index e9094c04f2e1..f1dede61555d 100644
--- a/junit-platform-reporting/junit-platform-reporting.gradle.kts
+++ b/junit-platform-reporting/junit-platform-reporting.gradle.kts
@@ -1,6 +1,5 @@
 plugins {
 	id("junitbuild.java-library-conventions")
-	id("junitbuild.native-image-properties")
 	id("junitbuild.shadow-conventions")
 	`java-test-fixtures`
 }
diff --git a/junit-platform-reporting/src/nativeImage/initialize-at-build-time b/junit-platform-reporting/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 1b4f355f53cf..000000000000
--- a/junit-platform-reporting/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,2 +0,0 @@
-org.junit.platform.reporting.open.xml.OpenTestReportGeneratingListener
-org.junit.platform.reporting.shadow.org.opentest4j.reporting.events.api.DocumentWriter$1
diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts
index 72f90de35321..36abcdbc088d 100644
--- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts
+++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts
@@ -1,6 +1,5 @@
 plugins {
 	id("junitbuild.java-library-conventions")
-	id("junitbuild.native-image-properties")
 }
 
 description = "JUnit Platform Suite Engine"
diff --git a/junit-platform-suite-engine/src/nativeImage/initialize-at-build-time b/junit-platform-suite-engine/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 5313fc54879d..000000000000
--- a/junit-platform-suite-engine/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,5 +0,0 @@
-org.junit.platform.suite.engine.SuiteEngineDescriptor
-org.junit.platform.suite.engine.SuiteLauncher
-org.junit.platform.suite.engine.SuiteTestDescriptor
-org.junit.platform.suite.engine.SuiteTestDescriptor$LifecycleMethods
-org.junit.platform.suite.engine.SuiteTestEngine
diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts
index 3d1231829fac..54d444b43c81 100644
--- a/junit-vintage-engine/junit-vintage-engine.gradle.kts
+++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts
@@ -1,7 +1,6 @@
 plugins {
 	id("junitbuild.java-library-conventions")
 	id("junitbuild.junit4-compatibility")
-	id("junitbuild.native-image-properties")
 	id("junitbuild.testing-conventions")
 	`java-test-fixtures`
 	groovy
diff --git a/junit-vintage-engine/src/nativeImage/initialize-at-build-time b/junit-vintage-engine/src/nativeImage/initialize-at-build-time
deleted file mode 100644
index 75ff3d41de5a..000000000000
--- a/junit-vintage-engine/src/nativeImage/initialize-at-build-time
+++ /dev/null
@@ -1,5 +0,0 @@
-org.junit.vintage.engine.VintageTestEngine
-org.junit.vintage.engine.descriptor.RunnerTestDescriptor
-org.junit.vintage.engine.descriptor.VintageEngineDescriptor
-org.junit.vintage.engine.support.UniqueIdReader
-org.junit.vintage.engine.support.UniqueIdStringifier


Test patch: