Skip to content

Maven examples & Gradle update #14

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Maven examples & Gradle update #14

wants to merge 3 commits into from

Conversation

hankem
Copy link
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 added 3 commits April 21, 2025 12:35
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>
to support more modern Java versions
e.g. https://docs.gradle.org/8.5/release-notes.html#full-java-21-support

Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
Signed-off-by: Manfred Hanke <Manfred.Hanke@tngtech.com>
@hankem
Copy link
Member Author

hankem commented Apr 24, 2025

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

@codecholeric
Copy link
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
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
Member Author

hankem commented May 4, 2025

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

Good idea!

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