Comments (9)
Are you sure that you picked up ArchUnit 1.2.0?
While I can reproduce the problem with ArchUnit ≤1.0.1, I cannot with ArchUnit ≥1.1.0.
#1098, released with ArchUnit 1.1.0, has updated ASM to version 9.5, which had added support for Java 21.
from archunit.
Cool; I'm glad that you could solve the problem! 🎉 Then I guess we can also close this issue?
from archunit.
#1098, released with ArchUnit 1.1.0, has updated ASM to version 9.5, which had added support for Java 21.
Thank you for this @hankem, appreciated. 🙏 Perhaps it would make sense to mention #1098 in the ArchUnit 1.1.0 release notes? Since it's such an important change, it deserves a bit more visibility IMO.
from archunit.
Okay, done.
from archunit.
The Rules we have created are using:
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
<version>1.2.0</version>
</dependency>
I have prepared a small quarkus project under: https://github.com/KaiSuchomel/quarkus_openapi/tree/issue/archunitWarningJDK21
When you excute mvn clean package
under JDK21 a lot of warnings occure in console:
[WARNING] Error during import from jrt:/java.base/java/lang/Object.class, falling back to simple import
java.lang.IllegalArgumentException: Unsupported class file major version 65
at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init> (ClassReader.java:199)
at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init> (ClassReader.java:180)
at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init> (ClassReader.java:166)
at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init> (ClassReader.java:287)
Perhaps its a problem in the arch-unit-maven-plugin
??
from archunit.
I finally found the Issue. The arch-unit-maven-plugin
with arch-unit-build-plugin-core
is using an older archunit (1.0.0).
With PR societe-generale/arch-unit-build-plugin-core#73 the Issue is gone.
from archunit.
Gonna close this issue for now, since it seems solved to me 🙂 Feel free to reopen if that's not the case...
from archunit.
well it is not the case with my setup and I don't use the plugin
00:48:10.193 [main] INFO com.tngtech.archunit.core.PluginLoader -- Detected Java version 21.0.1 00:48:10.490 [main] WARN com.tngtech.archunit.core.importer.ClassFileProcessor -- Couldn't import class from file:///.....class java.lang.IllegalArgumentException: Unsupported class file major version 65 at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init>(ClassReader.java:199) at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init>(ClassReader.java:180) at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init>(ClassReader.java:166) at com.tngtech.archunit.thirdparty.org.objectweb.asm.ClassReader.<init>(ClassReader.java:287) at com.tngtech.archunit.core.importer.ClassFileProcessor.process(ClassFileProcessor.java:69) at com.tngtech.archunit.core.importer.ClassFileImporter.importLocations(ClassFileImporter.java:325) at com.tngtech.archunit.core.importer.ClassFileImporter.importPackages(ClassFileImporter.java:214) at com.tngtech.archunit.core.importer.ClassFileImporter.importPackages(ClassFileImporter.java:225)
from archunit.
@danyel: I recommend running "mvn dependency:tree" and searching for archunit. In my case I found out that another outdated dependency under dependencyManagement (in my case spring-modulith-bom) was referencing archunit 1.0.1 even tough I wanted to use 1.2.1.
from archunit.
Related Issues (20)
- Wrong line numbers and constructor call order
- JavaType#getAllInvolvedRawTypes() throws StackOverflowError with self-referential generic types HOT 2
- @AnalyzeClasses breaks JUnit 5 tag filtering HOT 3
- Is there a way to know if JavaCodeUnit is a switch/case statement? HOT 4
- Custom Error Messages for StoreUpdateFailedException
- Remove false positives from Transactional Proxy Rule HOT 2
- question about calling line numbers HOT 3
- Using MethodReferences is still breaking soundness HOT 5
- Usability: Java confuses the static and non-static versions of DescribedPredicate.and() when using the API the wrong way. HOT 3
- Unable to find the JavaAccess call HOT 8
- Feature suggestion: Freeze files and stored.rules validation / sanity check
- How To : validate return type is not `void` HOT 2
- How To : Is there way to filter classes when using `importJar()` HOT 1
- DEPRECATED_API_SHOULD_NOT_BE_USED does not consider constants nor final fields HOT 2
- ASM is not up-to-date
- Jakarta Inject package name incorrect in BE_ANNOTATED_WITH_AN_INJECTION_ANNOTATION rule HOT 1
- How can I find out which gradle module a class belongs to HOT 7
- Problem with maven multi module project HOT 2
- False positive results when I use ArchRuleDefinition.noClasses() HOT 7
- Check access classes only works for some cases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from archunit.