Releases: TNG/ArchUnit
Releases · TNG/ArchUnit
ArchUnit 1.3.1
ArchUnit 1.4.0
Enhancements
Core
- Support Java 24 / class file major version 68 (#1364)
Lang
Library
- New
GeneralCodingRules.OLD_DATE_AND_TIME_CLASSES_SHOULD_NOT_BE_USED
(#1385; thanks to @Bukama 👏) - Improve
GeneralCodingRules.testClassesShouldResideInTheSamePackageAsImplementation
to not fail for classes with no tests in their packages (#1368; thanks to @krzysztof-owczarek 👏)
JUnit
- Fix failure when
junit.testFilter
is used (#1361; thanks to @Sparkymann 👏) - Enable
@AnalyzeClasses
annotation to be used as meta annotation (#1300; thanks to @mathze 👏)
Documentation
- Fix user guide describing wrong default behavior of
@AnalyzeClasses
(#1406) - Clarify Slices documentation (#1366; thanks to @mipo256 👏)
Internal improvements
ArchUnit 1.1.1
Bug Fixes
- Fix ArchUnit importer being unable to import classes from Spring Boot Nested jars (see #1224)
ArchUnit 1.2.2
Bug Fixes
- Fix ArchUnit importer being unable to import classes from Spring Boot Nested jars (see #1224)
ArchUnit 1.3.0
Bug Fixes
- Fix ArchUnit importer being unable to import classes from Spring Boot Nested jars (see #1224)
- Fix
OnionArchitecture
losingwithOptionalLayers()
on description override (see #1185) - Fix
JavaType.getAllInvolvedRawTypes()
recursing infinitely for recursive type definitions (see #1237) - Fix
@ArchTest
fields in base classes of@ArchIgnore
d classes not being ignored (see #1277)
Enhancements
Core
- Add support for Java 23 (see #1275; thanks a lot to @hankem)
- New method
JavaType.traverseSignature(..)
to examine parts of a type signature more conveniently (see 8456198 of #1276)
Lang
- Make handling specific violating object types with
ViolationHandler
more convenient (see #1251)
Library
- Jakarta EE annotations are now considered in
GeneralCodingRules.NO_CLASSES_SHOULD_USE_FIELD_INJECTION
(see #1285; thanks a lot to @hankem) - PlantUML rules now ignore dependencies between unparsable objects (e.g. a database instead of a regular component) (see #1132; thanks a lot to @tfij)
- PlantUML rules now optionally support the
component
keyword incomponent [Example] <<..example..>>
(see #1223; thanks a lot to @tfij)
JUnit
@ArchTest
s included viaArchTests.in(..)
now report their full "inclusion path" in the test report (see #452, #1279)- Specific
@ArchTest
rules can now be executed by setting the ArchUnit propertyjunit.testFilter=rule_field_name
/ setting the system property-Darchunit.junit.testFilter=...
(compare the user guide; see #1280)
Further Acknowledgement
ArchUnit 1.2.1
ArchUnit 1.2.0
Enhancements
Core
- Add support for Java 22 (see #1172; thanks a lot to @hankem)
- New methods
{JavaType/JavaMember}.getAllInvolvedRawTypes()
to quickly detect all raw types contributing to a type (e.g.List<? extends Serializable>
) or member (e.g.List<? extends Serializable> method(Set<String> args) {..}
) (see #723; thanks a lot to @leonardhusmann)
Lang
- New rules API
FieldsShould.{be/notBe}AccessedByMethodsThat(predicate)
to prevent fields from being accessed by certain methods (see #857; thanks a lot to @leonardhusmann)
Library
- New extensive modules rule syntax to support easier checks for modularization (dependency direction, API surface, ...) (compare the user guide; see #1078)
JUnit
Further Acknowledgement
- Thanks a lot to @SimonVerhoeven for improving the user guide (see #1140)
ArchUnit 1.1.0
Bug Fixes
- Try-Catch-Blocks declared within lambdas will now be detected correctly (see #1069)
- Fix ArchUnit not being able to find classes loaded by Spring Boot
ClassLoader
(see #1131; thanks a lot to @odrotbohm)
Enhancements
Core
- New
ImportOption
DoNotIncludeGradleTestFixtures
(see #949) - Reduce all log levels except
WARN
toTRACE
(see #1050) - Add support for Java 21 (see #1098)
Library
- Two new
GeneralCodingRules
(see #970; thanks a lot to @hankem)ASSERTIONS_SHOULD_HAVE_DETAIL_MESSAGE
DEPRECATED_API_SHOULD_NOT_BE_USED
TextFileBasedViolationStore
is now part of the public API and can thus be used for customization; as a special case of this file names can now be adjusted (see #1046; thanks a lot to @danhaywood)TextFileBasedViolationStore
now adds a final new line character to the violation file to better conform to the spec (see #1057; thanks a lot to @pkubowicz)
ArchUnit 1.0.1
Bug Fixes
- Fix bug where referenced class objects and instanceof checks were not detected if declared within a lambda (see #992)
- Fix empty records not being detected as records (see #998; thanks a lot to @hankem)
- Fix Javadoc on
layeredArchitecture()
missing the newconsideringDependencies
part (see #977; thanks a lot to @Thunderforge) - Fix user guide still showing
DescribedPredicate.apply
instead of.test
(see #978; thanks a lot to @thmuch)
ArchUnit 1.0.0
0.x
version, please also refer to the release notes of release candidate 1.0.0-rc1
as these release notes refer to upgrading from the release candidate
Breaking Changes
- Naming around
JavaPackage
subpackages and dependencies has been improved to remove ambiguities. In general, whenever all classes from a package and subpackages recursively are involved, this is now called "package tree". Otherwise, it only targets the classes directly within this package (see #919/#968; thanks a lot to @grimsa)
The following mapping shows how to translate the old methods to the current methods:getAllClasses()
->getClassesInPackageTree()
getAllSubpackages()
->getSubpackagesInTree()
getClassDependenciesFromSelf()
->getClassDependenciesFromThisPackageTree()
getClassDependenciesToSelf()
->getClassDependenciesToThisPackageTree()
getPackageDependenciesFromSelf()
->getPackageDependenciesFromThisPackageTree()
getPackageDependenciesToSelf()
->getPackageDependenciesToThisPackageTree()
accept(..)
->traversePackageTree(..)
- Importing the default package via
ClassFileImporter.importPackages("")
will now yields the same result as usingimportClasspath()
without anyImportOption
(see #954) ClassFileImporter.importClasspath()
now behaves consistently to other import APIs. I.e. no defaultImportOptions
likeDoNotIncludeArchives
are added anymore, instead allImportOptions
need to be added the same way as for all other import methods (see #958)- The custom collection
ImportOptions
has been removed from the public API and been replaced by a standardCollection<ImportOption>
where appropriate (see #958) - The package
com.tngtech.archunit.library.plantuml
has been moved tocom.tngtech.archunit.library.plantuml.rules
to make room for adding other PlantUML related features (see #959) - SLF4J-API has been upgraded from
1.7.30
to2.0.3
, so any log adapter dependency to be used with ArchUnit (e.g. to hook in Log4J) has to be compatible with SLF4J-API2.x
from now on (see #966)
Bug Fixes
- Fix bug where multiple synthetic access calls to methods like
access$123(..)
would lead to only one access being imported. Note, that these synthetic methods are added for calls to private fields / methods from inner classes to outer classes, etc. (see #957)
Enhancements
Lang
archunit_ignore_patterns.txt
is now also respected byFreezingArchRule
. Thus, ignored violations are not added to theViolationStore
anymore (see #915)
Library
testClassesShouldResideInTheSamePackageAsImplementation(..)
now supports multiple test classes with same simple name (see #918; thanks a lot to @mslowiak)PlantUmlArchCondition
now does not throw exceptions anymore, if a class is in none or multiple components, but instead reports those as standard violations. This way these violations can also be frozen viaFreezingArchRule
instead of crashing the test (see #960)
Further Acknowledgement
- Thanks a lot to @hankem for upgrading various dependencies, cleaning up code and extensive reviews