Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ All example rules you find within `src/test` refer to classes from `src/main`.
These tests are all designed to fail, to demonstrate how production code could violate
typical architectural constraints (like layer dependencies).

You can run them with Gradle

```
./gradlew build
```

Otherwise the tests can be run directly from any IDE.
You can run them

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

## Regarding issues

Expand Down
19 changes: 19 additions & 0 deletions example-junit4/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-examples</artifactId>
<version>1.4.2</version>
</parent>
<artifactId>archunit-example-junit4</artifactId>
<dependencies>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit4</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
4 changes: 4 additions & 0 deletions example-junit5/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
dependencies {
testImplementation 'com.tngtech.archunit:archunit-junit5:1.4.2'

// ArchUnit does not actually need the JUnit Jupiter API,
// but some IDEs support executing tests more conveniently when it is present.
testCompileOnly 'org.junit.jupiter:junit-jupiter-api:5.14.4'
}

test {
Expand Down
19 changes: 19 additions & 0 deletions example-junit5/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-examples</artifactId>
<version>1.4.2</version>
</parent>
<artifactId>archunit-example-junit5</artifactId>
<dependencies>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
3 changes: 1 addition & 2 deletions example-plain/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dependencies {
testImplementation 'junit:junit:4.12' // We will use JUnit to run the tests, but for this example it is irrelevant, might as well be TestNG

testImplementation 'junit:junit:4.13.2' // We will use JUnit to run the tests, but for this example it is irrelevant, might as well be TestNG
testImplementation 'com.tngtech.archunit:archunit:1.4.2'
}
25 changes: 25 additions & 0 deletions example-plain/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-examples</artifactId>
<version>1.4.2</version>
</parent>
<artifactId>archunit-example-plain</artifactId>
<dependencies>
<dependency> <!-- We will use JUnit to run the tests, but for this example it is irrelevant, might as well be TestNG -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.4.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
50 changes: 32 additions & 18 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 26 additions & 33 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading