dependencies {
- testImplementation 'com.tngtech.archunit:archunit-junit4:1.3.0'
+ testImplementation 'com.tngtech.archunit:archunit-junit4:1.4.0'
}
diff --git a/README.md b/README.md
index cb9029589..03c739327 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ framework.
###### Gradle
```
-testImplementation 'com.tngtech.archunit:archunit:1.3.0'
+testImplementation 'com.tngtech.archunit:archunit:1.4.0'
```
###### Maven
@@ -26,7 +26,7 @@ testImplementation 'com.tngtech.archunit:archunit:1.3.0'
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit4</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
<scope>test</scope>
</dependency>
dependencies {
- testImplementation 'com.tngtech.archunit:archunit-junit4:1.3.0'
+ testImplementation 'com.tngtech.archunit:archunit-junit4:1.4.0'
}
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
<scope>test</scope>
</dependency>
@@ -658,7 +658,7 @@ dependencies {
- testImplementation 'com.tngtech.archunit:archunit-junit5:1.3.0'
+ testImplementation 'com.tngtech.archunit:archunit-junit5:1.4.0'
}
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
<scope>test</scope>
</dependency>
@@ -684,7 +684,7 @@ dependencies {
- testImplementation 'com.tngtech.archunit:archunit:1.3.0'
+ testImplementation 'com.tngtech.archunit:archunit:1.4.0'
}
Which classes will be imported can be controlled in a declarative way through @AnalyzeClasses
.
-If no packages or locations are provided, the whole classpath will be imported.
+If no packages or locations are provided, the package of the annotated test class will be imported.
You can specify packages to import as strings:
ImportOption
and then supply the type to @AnalyzeClasses
.
To import the whole classpath, instead of just the package of the test class, use the option
+@AnalyzeClasses(wholeClasspath = true)
+Note that @AnalyzeClasses
can also be used as a meta-annotation to avoid repeating the same configuration:
@Retention(RetentionPolicy.RUNTIME)
+@AnalyzeClasses(packagesOf = MyApplicationRoot.class, importOptions = DoNotIncludeTests.class)
+public @interface AnalyzeMainClasses {}
+This annotation can then be used on test classes without repeating the specific configuration of @AnalyzeClasses
:
@AnalyzeMainClasses
+public class ArchitectureTest {
+ // ...
+}
+