diff --git a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java index 2bdb4e8c..c6b2c4bd 100644 --- a/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java +++ b/src/main/java/de/tum/cit/ase/ares/api/architecturetest/java/postcompile/CustomClassResolver.java @@ -3,7 +3,6 @@ import com.tngtech.archunit.core.domain.JavaClass; import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.importer.ClassFileImporter; -import com.tngtech.archunit.core.importer.ImportOption; import java.util.Optional; @@ -11,7 +10,6 @@ * Custom class resolver to resolve classes that are outside classpath to be able to analyze them transitively. */ public class CustomClassResolver { - /** * Class file importer to import the class files. * This is used to import the class files from the URL. @@ -19,9 +17,10 @@ public class CustomClassResolver { private final JavaClasses allClasses; public CustomClassResolver() { + // We need to import all classes to be able to resolve them later. + // TODO: We definitely need to improve this. We should not import all classes as it is not memory efficient. + // https://www.javadoc.io/doc/com.tngtech.archunit/archunit/0.10.2/com/tngtech/archunit/core/importer/ClassFileImporter.html allClasses = new ClassFileImporter() - .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) - .withImportOption(location -> location.toString().contains("jrt:/")) .importClasspath(); } diff --git a/src/main/resources/archunit.properties b/src/main/resources/archunit.properties index a536fac5..cd4e78b0 100644 --- a/src/main/resources/archunit.properties +++ b/src/main/resources/archunit.properties @@ -1,2 +1,3 @@ # Set to false to ignore missing dependencies in the classpath, as they are resolved manually by the de.tum.cit.ase.ares.api.architecturetest.java.postcompile.CustomClassResolver -resolveMissingDependenciesFromClassPath=false \ No newline at end of file +resolveMissingDependenciesFromClassPath=false +archRule.failOnEmptyShould=false \ No newline at end of file