Skip to content

Update Maven examples (and Gradle wrapper)#1450

Open
hankem wants to merge 4 commits into
mainfrom
update-Maven-examples
Open

Update Maven examples (and Gradle wrapper)#1450
hankem wants to merge 4 commits into
mainfrom
update-Maven-examples

Conversation

@hankem

@hankem hankem commented Apr 24, 2025

Copy link
Copy Markdown
Member

This PR extends the tasks triggered by updateArchUnitExample (in particular for every release), which update the ArchUnit-Examples, by

It also updates the example dependencies and Maven & Maven plugin version used in archunit-maven-test

hankem added 4 commits July 3, 2026 22:07
Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
which were introduced with TNG/ArchUnit-Examples#14

so `./gradlew updateArchUnitExample` also updates them,
not only the Gradle build files (see result in `build/example-update/`)

Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
using the Gradle wrapper from the ArchUnit repository, which is automatically updated,
so `./gradlew updateArchUnitExample` also updates it for the ArchUnit-Examples repository
(see result in `build/example-update/`)

Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Not updating maven-surefire-plugin beyond 3.0.0-M3:
Since apache/maven-surefire#214,
`surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java`
uses `className = testPlan.getParent(testIdentifier).getDisplayName()`
instead of `org.junit.platform.launcher.listeners.LegacyReportingUtils.getClassName(testPlan, testIdentifier)`
for `TestSource`s that are neither a `MethodSource` nor a `ClassSource`
(including ArchUnit's `FieldSource`, created by `ArchUnitRuleDescriptor`),
which causes the test report's testcase/@classname to not contain fully qualified class names anymore,
which breaks `TestResultTest` (`./gradlew :archunit-maven-test:verifyRulesJUnit5`).

Signed-off-by: Manfred Hanke <manfred.hanke@tngtech.com>
@hankem hankem force-pushed the update-Maven-examples branch from c61e9e0 to 2ceef68 Compare July 3, 2026 20:10
@@ -4,17 +4,19 @@ ext.archunitExamplesGitRepo = 'TNG/ArchUnit-Examples.git'
ext.updateArchUnitExampleVersion = { File archUnitExampleDir ->

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

can be tested with

./gradlew clean updateArchUnitExample && cd build/example-update/ && git diff

(noting that release.sh additionally does && git add -A && git commit -s -m "release ArchUnit $VERSION" && git push).

@schulzjo-tng schulzjo-tng self-requested a review July 10, 2026 05:29
Comment on lines -73 to +81
<version>2.22.2</version>
<version>3.0.0-M3</version> <!-- Since 3.0.0-M4, the test report for JUnit5 tests does not contain fully qualified names in testcase/@classname anymore. -->
<configuration>
<argLine>-Xmx2G</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.15.0</version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These collide with a change on #1659:

https://github.com/TNG/ArchUnit/pull/1659/changes#diff-37d07b0dd191f89abeecc0d77000a86578e68d32149148fbe71bf426ac4ce8f9L73-R81

I prefer my approach where this is covered by dependabot

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like your approach, and I don't think it's a semantic conflict, but that they complement each other nicely:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants