ArchUnit v0.13.1 Release Notes

Release Date: 2020-02-04 // 16 days ago
  • 🐛 Bug Fixes

    • 🛠 Fixed java.lang.IllegalStateException: Couldn't find module modules of URI jrt:/... being thrown when trying to import JDK classes where JDK version >= 13. The path handling of JrtFileSystemProvider has been fixed according to JEP-220 with JDK 13. Unfortunately ArchUnit was dependent on the old behavior. (see #303)

Previous changes from v0.13.0

  • 💥 Breaking Changes

    • 👀 While technically a very slim chance of really "breaking" anything, the log level of some details during the class file import has been reduced from DEBUG to TRACE (field, method, access and call details, ...) (see #291)

    ✨ Enhancements


    • 👀 Annotations and annotation parameters are now detected as dependencies. This could cause new findings when using the rules or library API. In particular JavaClass.getDirectDependencies{From/To}Self() will now also return Dependencies that originate from @FormerlyNotDetected or @Foo(someEnum = SomeEnumFormerlyNotDetected.FOO) or @Foo(bar = @Bar(type = SomeTypeFormerlyNotDetected.class)) (see #136; thanks a lot to @kosani)


    • 👀 Some rule API method parameter types were invariant instead of contravariant (effectively preventing a predicate for a super type to be passed). These methods should now be fixed (see #262)
    • 👀 The rules API now offers more methods to filter and assert the type of class declaration ("top level class", "nested class", "member class", "inner class", "anonymous class" and "local class") (see #207; many thanks to @rweisleder)


    • 👀 FreezingArchRule by default now not only ignores line numbers, but also numbers after $ which effectively makes the ViolationStore resilient against changes in compiled lambda and anonymous class names (see #248; thanks a lot to @hankem)
    • 👀 LayeredArchitecture and OnionArchitecture now allow to configure optionalLayers(). In version 0.12.0 the behavior was made more strict, forbidding empty layers / parts of LayeredArchitecture and OnionArchitecture to prevent misconfiguration. This in turn unfortunately broke some valid use cases where empty / optional layers were in fact okay. In version 0.13.0 this is now completely configurable. By default it will still fail to prevent misconfiguration, but a switch of withOptionalLayers(true) or optionalLayer("Some Layer") will allow empty layers (and in turn empty parts of OnionArchitecture) (see #267 and #271; many thanks to @hankem)


    • there is now a ArchUnit JUnit 5 aggregator POM, i.e. instead of two dependencies archunit-junit5-api and archunit-junit5-engine, it is now also possible to simply add a single dependency archunit-junit5 with scope test / testCompile. Compare the user guide (see #272; thanks a lot to @eddumelendez)
    • ⬆️ Dependency upgrades (see #292)
      • junit-platform-* from 1.5.1 to 1.5.2
      • junit4 from 4.12 to 4.13 (in case of problems with archunit-junit4 it should be possible to exclude the transitive dependency to JUnit 4.13 and replace it by a custom 4.12 one)

    Further Acknowledgement

    • Many thanks to @Bananeweizen for fixing spelling and grammar mistakes in Javadoc / methods