Skip to content

Maven examples & Gradle update#14

Merged
hankem merged 4 commits into
mainfrom
Maven
May 25, 2026
Merged

Maven examples & Gradle update#14
hankem merged 4 commits into
mainfrom
Maven

Conversation

@hankem
Copy link
Copy Markdown
Member

@hankem hankem commented Apr 22, 2025

This PR

  • adds pom.xml files to run the examples with Maven
  • updates Gradle to support more modern Java versions
  • improves the user experience when running the junit5 examples with IntelliJ IDEA

@hankem
Copy link
Copy Markdown
Member Author

hankem commented Apr 24, 2025

FYI: TNG/ArchUnit#1450 will update these pom.xmls with every release of ArchUnit.

@codecholeric
Copy link
Copy Markdown
Collaborator

I appreciate the initiative to also make these examples work with Maven, but do you think it's easy to understand if both Maven and Gradle are mixed together? Or should we have dedicated examples? 🤔 In the end we're updating those automatically anyway, right? We could also adapt that to generate two sets of examples, one for Gradle and one for Maven?

Also, would it make sense to use the https://maven.apache.org/wrapper/ analogously to Gradle?

@hankem
Copy link
Copy Markdown
Member Author

hankem commented May 4, 2025

do you think it's easy to understand if both Maven and Gradle are mixed together? Or should we have dedicated examples?

As this repository is about ArchUnit examples, I thought it would be fair to support multiple build tools in the same module (and not duplicate the examples just because there are several ways to run them). Would it be more clear to state in the README:

You can run them

  • with Gradle (using the provided build.gradle scripts):
    ./gradlew test
    
  • with Maven (using the provided pom.xml files in the same directories):
    ./mvnw test
    
  • or directly from your IDE.

@hankem
Copy link
Copy Markdown
Member Author

hankem commented May 4, 2025

would it make sense to use the https://maven.apache.org/wrapper/

Good idea!

hankem added 4 commits May 25, 2026 19:24
IntelliJ IDEA did not offer to execute the `example-junit5` tests directly from the IDE,
but adding the `junit-jupiter-api` dependency changed this inconvenient behavior.

I've added the dependency to the `testCompileOnly` configuration
to suggest that it is not actually needed.

Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
@hankem hankem merged commit 038768e into main May 25, 2026
1 check passed
@hankem hankem deleted the Maven branch May 26, 2026 06:24
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