Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Upgrade to Native Build Tools 0.9.7.1 #1206

Conversation

sbrannen
Copy link
Contributor

@sbrannen sbrannen commented Nov 2, 2021

See #1202 for background information.


This PR upgrades the spring-aot-gradle-plugin and all Maven based sample apps to Native Build Tools (NBT) 0.9.7.1

NBT 0.9.6 requires JUnit Platform 1.8 (JUnit 5.8) due to its dependency on the UniqueIdTrackingListener in the junit-platform-launcher artifact. The Maven sample apps are currently based on Spring Boot 2.6 RC1 which uses JUnit 5.8.1 (JUnit Platform 1.8.1). Thus, there is no conflict between the JUnit version used in the sample apps and the version used by NBT.

However, there is an issue regarding Maven Surefire.

Maven Surefire 3.0.0-M4 introduced support for automatically aligning the JUnit Platform version used by Surefire with the version needed by the user's configured version of JUnit Jupiter. Since we are not using Surefire 3.0 milestones, the parent POM for the Maven sample apps has to explicitly declare a dependency on the correct version of the junit-platform-launcher in order to make the UniqueIdTrackingListener available for Native Build Tools 0.9.6 and higher. The actual version of the junit-platform-launcher is managed by the junit-bom that is imported by the spring-boot-starter-parent.

This PR also removes build-time initialization for org.junit.platform.launcher.TestIdentifier, since that is already handled by the JUnitPlatformFeature in the Native Build Tools (starting with version 0.9.6).

This commit upgrades the spring-aot-gradle-plugin and all Maven based
sample apps to Native Build Tools (NBT) 0.9.7.1

NBT 0.9.6 requires JUnit Platform 1.8 (JUnit 5.8) due to its dependency
on the UniqueIdTrackingListener in the junit-platform-launcher
artifact. The Maven sample apps are currently based on Spring Boot 2.6
RC1 which uses JUnit 5.8.1 (JUnit Platform 1.8.1). Thus, there is no
conflict between the JUnit version used in the sample apps and the
version used by NBT.

However, there is an issue regarding Maven Surefire.

Maven Surefire 3.0.0-M4 introduced support for automatically aligning
the JUnit Platform version used by Surefire with the version needed by
the user's configured version of JUnit Jupiter. Since we are not using
Surefire 3.0 milestones, the parent POM for the Maven sample apps has
to explicitly declare a dependency on the correct version of the
junit-platform-launcher in order to make the UniqueIdTrackingListener
available for Native Build Tools 0.9.6 and higher. The actual version
of the junit-platform-launcher is managed by the junit-bom that is
imported by the spring-boot-starter-parent.

Closes spring-atticgh-1202
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 2, 2021
@sbrannen sbrannen added type: dependency-upgrade A dependency upgrade and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 2, 2021
@sbrannen sbrannen self-assigned this Nov 2, 2021
This commit effectively reverts 947bd7d, since the JUnitPlatformFeature
in the Native Build Tools project already configures the JUnit Platform
TestIdentifier for build-time initialization.

See spring-atticgh-1202
@sbrannen sbrannen added this to the 0.11.0-M2 milestone Nov 2, 2021
Copy link
Contributor

@sdeleuze sdeleuze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also update the documentation accordingly (version, Maven configuration)?

@sdeleuze sdeleuze merged commit 4322355 into spring-attic:main Nov 2, 2021
@sdeleuze
Copy link
Contributor

sdeleuze commented Nov 2, 2021

I will do the polish myself in order to be able to run a CI full build tonight.

sdeleuze added a commit that referenced this pull request Nov 2, 2021
@sbrannen
Copy link
Contributor Author

sbrannen commented Nov 3, 2021

I will do the polish myself in order to be able to run a CI full build tonight.

OK. Thanks!

@sbrannen
Copy link
Contributor Author

sbrannen commented Nov 3, 2021

Could you please also update the documentation accordingly (version, Maven configuration)?

Regarding the Maven configuration, I think we should probably add a note to the user documentation similar to the following comment:

https://github.com/spring-projects-experimental/spring-native/blob/41591f840429267722fcc0f78bc6ad9648480b7a/samples/maven-parent/pom.xml#L183-L193

Otherwise, Spring Boot users will be confused when the Native Build Tools Maven plugin fails to find the "unique ID files" that should be generated by the UniqueIdTrackingListener.

There should eventually be a note the NBT documentation (see graalvm/native-build-tools#151), but users might fail to see that.

@sdeleuze, what do you think?

@sdeleuze
Copy link
Contributor

sdeleuze commented Nov 5, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: dependency-upgrade A dependency upgrade
Development

Successfully merging this pull request may close these issues.

None yet

3 participants