You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2023/01/20 08:18:00 UTC

[jira] [Commented] (MCOMPILER-481) JPMS Regression: cannot access (requires static module not include anymore)

    [ https://issues.apache.org/jira/browse/MCOMPILER-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679050#comment-17679050 ] 

Tamas Cservenak commented on MCOMPILER-481:
-------------------------------------------

When building maven-compiler-plugin master with Maven 3.9.0 this IT fails
{noformat}
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 62, Failed: 1, Errors: 0, Skipped: 5
[INFO] -------------------------------------------------
[ERROR] The following builds failed:
[ERROR] *  MCOMPILER-481-requires-static-included/pom.xml
[INFO] ------------------------------------------------- {noformat}
Using
{noformat}
[cstamas@urnebes maven-compiler-plugin]$ java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)
[cstamas@urnebes maven-compiler-plugin]$ mvn -v
Apache Maven 3.9.0-SNAPSHOT (f7ca0b697ac7223b42d982d92cad5af48c9d184d)
Maven home: /home/cstamas/.sdkman/candidates/maven/current
Java version: 11.0.17, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/11.0.17-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.1.6-200.fc37.x86_64", arch: "amd64", family: "unix"
[cstamas@urnebes maven-compiler-plugin]$  {noformat}
 

> JPMS Regression: cannot access <class> (requires static module not include anymore)
> -----------------------------------------------------------------------------------
>
>                 Key: MCOMPILER-481
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-481
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.9.0
>            Reporter: Simone Bordet
>            Assignee: Olivier Lamy
>            Priority: Blocker
>             Fix For: 3.10.0
>
>         Attachments: compiler-bug.tar.gz
>
>
> Version 3.8.1 is not affected.
> The problem lies in how the module-path is constructed by the maven-compiler-plugin – not sure what changes from 3.8.1 caused this.
> In 3.8.1:
> {code:java}
> -d
>   /home/simon/tmp/compiler-bug/app/target/test-classes
> -classpath
>   /home/simon/tmp/compiler-bug/app/target/test-classes
>   /home/simon/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.2/junit-jupiter-api-5.8.2.jar
>   /home/simon/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
>   /home/simon/.m2/repository/org/junit/platform/junit-platform-commons/1.8.2/junit-platform-commons-1.8.2.jar
>   /home/simon/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
>   
> --module-path
>   /home/simon/tmp/compiler-bug/app/target/classes
>   /home/simon/.m2/repository/org/example/compiler-bug-service/1.0-SNAPSHOT/compiler-bug-service-1.0-SNAPSHOT.jar
>   /home/simon/.m2/repository/org/eclipse/jetty/jetty-util-ajax/10.0.7/jetty-util-ajax-10.0.7.jar
>   /home/simon/.m2/repository/org/eclipse/jetty/jetty-util/10.0.7/jetty-util-10.0.7.jar
>   /home/simon/.m2/repository/org/slf4j/slf4j-api/2.0.0-alpha5/slf4j-api-2.0.0-alpha5.jar
>   
> -sourcepath
>   /home/simon/tmp/compiler-bug/app/src/test/java
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
>   
> -s
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
> -g
> -nowarn
> --release
>   11
> -encoding
>   UTF-8
> --patch-module
>   compiler.bug.app=/home/simon/tmp/compiler-bug/app/target/classes
>   /home/simon/tmp/compiler-bug/app/src/test/java
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
>   
> --add-reads
>   compiler.bug.app=ALL-UNNAMED {code}
> In 3.9.0:
> {code:java}
> -d
>   /home/simon/tmp/compiler-bug/app/target/test-classes
> -classpath
>   /home/simon/tmp/compiler-bug/app/target/test-classes
>   /home/simon/.m2/repository/org/eclipse/jetty/jetty-util-ajax/10.0.7/jetty-util-ajax-10.0.7.jar
>   /home/simon/.m2/repository/org/eclipse/jetty/jetty-util/10.0.7/jetty-util-10.0.7.jar
>   /home/simon/.m2/repository/org/slf4j/slf4j-api/2.0.0-alpha5/slf4j-api-2.0.0-alpha5.jar
>   /home/simon/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.2/junit-jupiter-api-5.8.2.jar
>   /home/simon/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
>   /home/simon/.m2/repository/org/junit/platform/junit-platform-commons/1.8.2/junit-platform-commons-1.8.2.jar
>   /home/simon/.m2/repository/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar
>   
> --module-path
>   /home/simon/tmp/compiler-bug/app/target/classes
>   /home/simon/.m2/repository/org/example/compiler-bug-service/1.0-SNAPSHOT/compiler-bug-service-1.0-SNAPSHOT.jar
>   
> -sourcepath
>   /home/simon/tmp/compiler-bug/app/src/test/java
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
>   
> -s
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
> -g
> -nowarn
> --release
>   11
> -encoding
>   UTF-8
> --patch-module
>   compiler.bug.app=/home/simon/tmp/compiler-bug/app/target/classes
>   /home/simon/tmp/compiler-bug/app/src/test/java
>   /home/simon/tmp/compiler-bug/app/target/generated-test-sources/test-annotations
>   
> --add-reads
>   compiler.bug.app=ALL-UNNAMED {code}
> Running with 3.9.0 yields:
> {code:java}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.9.0:testCompile (default-testCompile) on project compiler-bug-app: Compilation failure
> [ERROR] /home/simon/tmp/compiler-bug/app/src/test/java/org/test/app/MainTest.java:[12,38] cannot access org.eclipse.jetty.util.ajax.JSON
> [ERROR]   class file for org.eclipse.jetty.util.ajax.JSON not found {code}
> Class {{JSON}} is in {{{}jetty-util-10.0.7.jar{}}}.
> In 3.9.0 this jar is missing from the module-path, causing the error.
> Attached you can find a reproducer: switch the maven-compiler-plugin version from 3.8.1 (works) to 3.9.0 (does not work) in the main POM.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)