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

2023-01-30 Thread Olivier Lamy (Jira)


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

Olivier Lamy commented on MCOMPILER-481:


[~cstamas] good catch!! maybe you can lock the surefire plugin version in the IT
but again another difference between what m-compiler-p is doing for jpms and 
what surefire is doing... 臘

> JPMS Regression: cannot access  (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 

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

2023-01-30 Thread Tamas Cservenak (Jira)


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

Tamas Cservenak commented on MCOMPILER-481:
---

This seems like Surefire 3.0.0-M8 bug (as it is used by Maven 3.9 and Maven 
4.0), as Maven 3.8.7 uses ancient 2.x surefire (the IT fails at test, 
compilation passes OK in 3.9.x)

> JPMS Regression: cannot access  (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 

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

2023-01-21 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

[~cstamas] what makes you think it is a plugin bug? 
https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-compiler-plugin/job/master/
 is green. Tested succesfully locally with 3.8.7, but failed with 
3.9.0-SNAPSHOT. Looks more like a Maven bug.

> JPMS Regression: cannot access  (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 

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

2023-01-20 Thread Tamas Cservenak (Jira)


[ 
https://issues.apache.org/jira/browse/MCOMPILER-481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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  (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
>   
> 

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

2022-11-30 Thread Jira


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

Jörg Hohwiller commented on MCOMPILER-481:
--

https://stackoverflow.com/questions/74635027/java-compiler-error-cannot-access-class-file-for-not-found

> JPMS Regression: cannot access  (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 

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

2022-02-01 Thread Olivier Lamy (Jira)


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

Olivier Lamy commented on MCOMPILER-481:


ETA plexus-java released.

still the m-c-p PR to merge

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-25 Thread Olivier Lamy (Jira)


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

Olivier Lamy commented on MCOMPILER-481:


[~rfscholte] please have a look 
[https://github.com/codehaus-plexus/plexus-languages/pull/106]

this is fixing both issues 

and need compiler-plugin PR as well 
[https://github.com/apache/maven-compiler-plugin/pull/82]

but to test m-c-p PR you need a local build of plexus-languages PR 

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-24 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

{quote}Shouldn't we automatically add test dependencies coming from the pom in 
module-path for test?{quote}

No, that would mean that for instance junit ends up on the modulepath, that 
doesn't make sense.
Only jars that are used by both compile and test should be added to the 
modulepath.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-24 Thread Martin Tzvetanov Grigorov (Jira)


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

Martin Tzvetanov Grigorov commented on MCOMPILER-481:
-

https://issues.apache.org/jira/browse/MCOMPILER-482 is a similar issue like 
this one. You can take an inspiration from it for more test cases.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-24 Thread Olivier Lamy (Jira)


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

Olivier Lamy commented on MCOMPILER-481:


I find it strange we almost do not read anything from pom regarding (test?) 
dependencies.

Shouldn't we automatically add test dependencies coming from the pom  in 
module-path  for test?

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-22 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

As I read it, it can only happen with test-compile. It looks like that only 
need the includeStatic option, and plexus-java needs to make sure it will 
include them static required modules, no matter the depth.
And there's the tricky part, as is it recursive code: direct static modules 
should always be included, indirect static modules depend on this flag.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-21 Thread Simone Bordet (Jira)


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

Simone Bordet commented on MCOMPILER-481:
-

There was a reply in the compiler-dev thread.

IIUC, when the {{compiler.bug.service}} module is imported as a dependency, it 
does not import (because it's a {{{}requires static{}}}) the 
{{jetty-util-ajax}} jar.

So when compiling the module {{compiler.bug.app,}} the "app" module sees the 
{{JSON}} class because of {{{}--add-reads compiler.bug.app=ALL-UNNAMED{}}}, but 
the "service" module still does not see it because it's not in the module-path 
and neither there is an {{--add-reads}} for the "service" module.

So it seems a legit Maven Compiler Plugin issue/ feature that needs to be 
supported.

In light of this information, is my algorithm or [~rfscholte]'s algorithm the 
right solution?

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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}
> 

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

2022-01-21 Thread Simone Bordet (Jira)


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

Simone Bordet commented on MCOMPILER-481:
-

https://mail.openjdk.java.net/pipermail/compiler-dev/2022-January/018989.html

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-21 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

Let's see what we'll get back from the compiler-dev list. The 
[ResolvePathsRequest|https://github.com/codehaus-plexus/plexus-languages/blob/master/plexus-java/src/main/java/org/codehaus/plexus/languages/java/jpms/ResolvePathsRequest.java#L206-L210]
 has an option to enforce extra modules, maybe we need to expose that as a 
workaround.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-21 Thread Simone Bordet (Jira)


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

Simone Bordet commented on MCOMPILER-481:
-

??And I agree with [~sbordet]: it is very weird that {{--add-reads 
compiler.bug.app=ALL-UNNAMED}} doesn't work.??

I'll send an email to compiler-dev, linking this issue.

In any case, it will be fixed for Java 19, perhaps backported, so we still need 
a workaround in Maven, right?

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-21 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

[~sbordet] smart to add those numbers :) I just don't understand the add-reads 
is ignored in this case by the compiler.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-21 Thread Simone Bordet (Jira)


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

Simone Bordet commented on MCOMPILER-481:
-

[~rfscholte] I was thinking a variation of your algorithm above, like this:

>From {{module-info.java}} files:
 # required modules should be included in module-path
 # transitively resolved required modules should be included in module-path
 # direct static requires modules should be included in module-path
 # indirect static required modules should _not_ be included in module-path

>From the POM:
 # every dependency that belongs to any of the categories above (included the 
last one) should be included in module-path, if not already
 # every dependency that does _not_ belong to the categories above should be 
included in the class-path.

For my specific case, {{jetty-util-ajax}} belongs to category module-info(4), 
and will be included in the module-path by pom(1), but {{junit}} belongs to 
category pom(2), so it can remain in the class-path (with the usual 
{{{}--add-reads =ALL-UNNAMED{}}}).

Thoughts?

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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
>   

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

2022-01-21 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

This is how I think it should work for compilation:
Based on the module descriptor:
- direct static required modules should always be included
- indirect required modules should always be included
- indirect static required modules should not be included

Based on the pom:
- every direct dependency should be added to the module path. 

In this case the jetty-util-ajax should be added based on the last rule, but 
(most likely) is removed because it is also an indirect required module. For an 
unrelated dependency like junit it works as expected.



> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-19 Thread Olivier Lamy (Jira)


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

Olivier Lamy commented on MCOMPILER-481:


[~rfscholte]  I started a branch called MCOMPILER-481-requires-static-included 
draft PR [https://github.com/apache/maven-compiler-plugin/pull/82]

This PR include the sample project as a new IT test.

simple change ResolvePathsRequest.setIncludeStatic(true) do not fix the problem

I made some other changes in plexus-java see draft PR 
[https://github.com/codehaus-plexus/plexus-languages/pull/106] the changes fix 
this problem but there is now 2 test failures

still investigating

 

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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] 
> 

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

2022-01-19 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

Found it, it was MJAVADOC-677 that required this change.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-19 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

`ResolvePathsRequest.setIncludeStatic(true)` did fix it for me, still wondering 
if this is the right approach.

> JPMS Regression: cannot access  (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: Major
> Fix For: 3.9.1
>
> 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 

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

2022-01-18 Thread Robert Scholte (Jira)


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

Robert Scholte commented on MCOMPILER-481:
--

Based on the test, it is about supporting "static transitive", which is very 
unusual but valid. I should have added a cross-link to the original issue in 
one of the plugins.

> JPMS Regression: cannot access  (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
>Priority: Major
> 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