Git Product home page Git Product logo

Comments (9)

hankem avatar hankem commented on August 15, 2024 1

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.

hankem avatar hankem commented on August 15, 2024 1

Cool; I'm glad that you could solve the problem! 🎉 Then I guess we can also close this issue?

from archunit.

perlun avatar perlun commented on August 15, 2024 1

#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.

hankem avatar hankem commented on August 15, 2024 1

Okay, done.

from archunit.

KaiSuchomel avatar KaiSuchomel commented on August 15, 2024

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.

KaiSuchomel avatar KaiSuchomel commented on August 15, 2024

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.

codecholeric avatar codecholeric commented on August 15, 2024

Gonna close this issue for now, since it seems solved to me 🙂 Feel free to reopen if that's not the case...

from archunit.

danyel avatar danyel commented on August 15, 2024

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)

image

from archunit.

patrickuhlmann avatar patrickuhlmann commented on August 15, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.