[jira] [Updated] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel_K updated SUREFIRE-1811: -- Component/s: Maven Surefire Plugin > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849446#comment-17849446 ] Pavel_K commented on SUREFIRE-1811: --- The problem still exists. For example, situation - one jpms module {code:java} module my.module {...} {code} with javafx css files and one test module with the same name {code:java} open module my.module {...} {code} in the same project. I can't execute tests because resources are absent. [~sor] , could you say if you found a solution? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (MCOMPILER-569) Plugin doesn't exclude module-info
Pavel_K created MCOMPILER-569: - Summary: Plugin doesn't exclude module-info Key: MCOMPILER-569 URL: https://issues.apache.org/jira/browse/MCOMPILER-569 Project: Maven Compiler Plugin Issue Type: Bug Affects Versions: 3.11.0 Reporter: Pavel_K The following code must exclude maven-info file. {code:java} maven-compiler-plugin 3.11.0 ${maven.compiler.source} ${maven.compiler.target} **/module-info.java {code} However, plugin compiles module-info and adds module-info.class to jar file -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17426771#comment-17426771 ] Pavel_K commented on MNG-7037: -- [~rfscholte] Could you explain, what you suggest to solve this problem? I wouldn't like to wait one more year. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262113#comment-17262113 ] Pavel_K commented on MNG-7037: -- [~rfscholte] Important note - I don't know maven internal work, what I can say is the following. For my purposes I merged the following jars : maven-artifact-3.6.3.jar maven-builder-support-3.6.3.jar maven-model-3.6.3.jar maven-model-builder-3.6.3.jar maven-repository-metadata-3.6.3.jar into one (maven-selected) and it works just fine as JPMS module. I did it to solve split packages problem. However, I don't know (and can't know) if there won't be problems for other automatic modules (for example, classloader issues). > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17262110#comment-17262110 ] Pavel_K commented on MNG-7037: -- [~rfscholte] Yes, I understand that to modularize the project is very difficult and time consuming. That's why I suggest firstly to implement only phase one - change package names and add Automatic-Module-Name to manifest. Of course, is requires some work, but is much much easier and faster to implement. Phase 1 will already allow others to use maven in JPMS environment. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261950#comment-17261950 ] Pavel_K edited comment on MNG-7037 at 1/9/21, 9:11 PM: --- [~rfscholte] From here https://stackoverflow.com/a/46504438/5057736 There are two ways to infer an automatic module's name: entry in the manifest guess from the JAR file name In the first case, the name was deliberately picked by the maintainer, so it can be assumed to be stable _(for example it doesn't change when the project gets modularized)_. As I said, automatic modules are used as a phase 1 when project (library) can be used in JPMS environment, however project is not modularized according to JPMS (phase 2). was (Author: pavel_k): [~rfscholte] From here https://stackoverflow.com/a/46504438/5057736 There are two ways to infer an automatic module's name: entry in the manifest guess from the JAR file name In the first case, the name was deliberately picked by the maintainer, so it can be assumed to be stable *(for example it doesn't change when the project gets modularized)*. As I said, automatic modules are used as a phase 1 when project (library) can be used in JPMS environment, however project is not modularized according to JPMS (phase 2). > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261950#comment-17261950 ] Pavel_K commented on MNG-7037: -- [~rfscholte] From here https://stackoverflow.com/a/46504438/5057736 There are two ways to infer an automatic module's name: entry in the manifest guess from the JAR file name In the first case, the name was deliberately picked by the maintainer, so it can be assumed to be stable *(for example it doesn't change when the project gets modularized)*. As I said, automatic modules are used as a phase 1 when project (library) can be used in JPMS environment, however project is not modularized according to JPMS (phase 2). > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261949#comment-17261949 ] Pavel_K commented on MNG-7037: -- [~rfscholte] Ok. Can you say, if this issue will be resolved and if yes, then when (approximately of course). > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261883#comment-17261883 ] Pavel_K commented on MNG-7037: -- [~rfscholte] By the way, could you say, what experts agree that for an old codebase like Maven it is not worth it to solve the split package issue. I opened tens of issues for JPMS support and didn't see something like this. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261879#comment-17261879 ] Pavel_K commented on MNG-7037: -- [~rfscholte] There are different module types (https://github.com/tfesenko/Java-Modules-JPMS-CheatSheet): # explicit named (with module-info, with exports/opens and internal packages) # automatic named (without module-info, module exports all packages and also opens them for deep reflection) As maven is old, it can be difficult to create explicit modules with open and hidden packages. However, it is absolutely possible to create automatic modules - the only thing that is required is to solve split package problem. So, it is not necessary to change package access - that can be really very difficult. The first phase is just to remove split package [+ add automatic module name]. Many library go this way - firstly they create automatic modules and then, if they have resources and if it necessary they create explicit modules, for example Jetty (AFAIR). However, "we won't support JPMS" decision is a wrong one, because all libraries and programs that plan to develop (not to die) slowly add JPMS support. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Minor > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257676#comment-17257676 ] Pavel_K commented on SUREFIRE-1811: --- Good news! NetBeans now support in-module testing when main module name = test module name. For details see https://issues.apache.org/jira/browse/NETBEANS-4550 . [~sor] Your article https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html helps very much to explain details. So, this issue is the only problem for the case when main module name = test module name. [~tibordigana] Could you say if you are going to fix it? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17248422#comment-17248422 ] Pavel_K commented on MNG-7037: -- [~michael-o] Package naming strategy must be developed by the lead developers of the project. I am just a maven user. So, it is at least wrong to suggest me to make a PR. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Major > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (MNG-7037) Add JPMS support -> solve split packages problem
[ https://issues.apache.org/jira/browse/MNG-7037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17239895#comment-17239895 ] Pavel_K commented on MNG-7037: -- [~michael-o] No, as I need to use org.apache.maven.repository.internal.MavenRepositorySystemUtils. Please, see this example https://github.com/apache/maven-resolver/blob/master/maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/manual/ManualRepositorySystemFactory.java . To tell the truth I don't see what to discuss here. It is just necessary to think package naming and to implement it. > Add JPMS support -> solve split packages problem > > > Key: MNG-7037 > URL: https://issues.apache.org/jira/browse/MNG-7037 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.6.3 >Reporter: Pavel_K >Priority: Major > > I use apache maven with apache maven resolver in JPMS environment as > automatic modules. At least I wanted to use them this way. When I started my > application I got > java.lang.module.ResolutionException: Modules maven.model.builder and > maven.model export package org.apache.maven.model.merge to module > mymodule.core. > Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (MNG-7037) Add JPMS support -> solve split packages problem
Pavel_K created MNG-7037: Summary: Add JPMS support -> solve split packages problem Key: MNG-7037 URL: https://issues.apache.org/jira/browse/MNG-7037 Project: Maven Issue Type: Bug Affects Versions: 3.6.3 Reporter: Pavel_K I use apache maven with apache maven resolver in JPMS environment as automatic modules. At least I wanted to use them this way. When I started my application I got java.lang.module.ResolutionException: Modules maven.model.builder and maven.model export package org.apache.maven.model.merge to module mymodule.core. Please, add JPMS support. 2020 is ending and there are still split packages. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17161358#comment-17161358 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] It seems that we stopped. Can you suggest a solution to this issue? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154410#comment-17154410 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] In my test I use ClassGraph that scan any module. For example, it firstly find api.text in com.foo.api module. So, here the problem is not in opening the module. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154194#comment-17154194 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] I tried this : {code:java} org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5 **/*IT.java false --add-modules ALL-MODULE-PATH {code} However, my test https://github.com/PashaTurok/jpms-resource-test1 didn't pass. Could you make it work? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154191#comment-17154191 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] > Okay, so if I understand you correctly nothing is blocking you from running > white-box unit tests on the classpath. Here is the question what I can do and what I will do. # I can use OSGI with JPMS that is suggested now by OSGi alliance (and they are serious). Can I? Yes, I can. Will I? No, I won't. # I can within one project use different approaches - main code in JPMS modules, IT tests in JPMS modules, unit tests on class path. Can I? Yes, I can. Will I? No, I won't. Here the keyword is "standardization" + JPMS advantages. For example, to provide services I always use only module-info but not {{/META-INF/services}}. Another example - I always control modules that are used during program running via module-info - the keyword is "reliable configuration". # I can forget JPMS and use only class path. Guess the answer. It seems to me, that you miss some important things. You consider using jpms for running unit modules only for relation between your tests and classes under test. I agree that it is difficult to see jpms advantage here. However, I suggest you to look at the whole "application" that is running when your tests are executed. For example, you have some testing library that you use in your tests. How will your organize your library? I think you will have some API and some impl. And I think you would like to hide your impl and open your API before using this library in 1000 tests. So, the keyword here is "encapsulation". If you are on class-path forget about some auto control. If you run your tests in jpms env, jpms will provide you a mechanism to control access to your impl code. So, here we see a jpms advantage. I think you can find other advantages by yourself if you look at the problem from this point of view. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154013#comment-17154013 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] I know the link you provided, because using that link I found out how to use TestExecutionListener. I just showed you how JPMS makes it easier to use/provide services and an example how JPMS can be used during unit tests. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153744#comment-17153744 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] Concrete case: I need to control test executing for logging. So, I just have in my module-info: {code:java} provides org.junit.platform.launcher.TestExecutionListener with com.foo.TestExecutionListenerImpl; {code} What about detailed answer. I can only express you my opinion and I've done it. However, I can't persuade you - it is up to you. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153664#comment-17153664 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] Yes, you are right - I do whitebox unit testing. The question is, why I put my unit tests on module path and don't leave them on class path. Because: # JPMS is an environment it is always a right way to test your application on all testing levels in the same environment. # There is a global movement to JPMS and this movement includes tests. # You can work with test infrastructure (junit etc) with all JPMS advantages. # Here we speak not about concrete project but about any possible JPMS project. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153641#comment-17153641 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] > 1) Omit {{src/main/module-info.java}}. Or You can't omit it because it will become non jpms module. > 2) Add {{src/test/module-info.java}} and add qualified exports from > {{src/main/module-info.java}} to your test module. Again main module must know nothing about testing module. At the same time, as it was described above there 4 ways and everyone can use the way he find the most suitable. For me I've chosen 3.1 for IT and 3.2 for unit tests. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153639#comment-17153639 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] Sorry, about question 2 - we need separate module-info in src/test/module-info because we can add there additional dependencies, for example, junit, hamcrest etc. Have I answered your questions? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153621#comment-17153621 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] 3.2 I use only for unit testing. For integration testing I create separate maven project with its own module-info. So, for unit testing I use 3.2 and for IT testing I use 3.1. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153506#comment-17153506 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana]No, in this issue I am talking ONLY about 3.2. I gave a full test - here [https://github.com/PashaTurok/jpms-resource-test1] I 've shown where the problem can be. But how to fix this issue - sorry, I don't know. Maybe [~sor] can say (he suggested, as I remember, --patch-module com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/target/classes). > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153455#comment-17153455 ] Pavel_K edited comment on SUREFIRE-1811 at 7/8/20, 10:00 AM: - [~tibordigana]I think the problem is the following. Please, open jpms-resource-test1/com.foo.impl/target/test-classes/META-INF/jpms.args: --patch-module com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/java, /home/pavel/Temp/jpms-resource-test1/com.foo.impl/target/generated-sources/annotations As I understand we need to add com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/resources if they exist. You know here better. was (Author: pavel_k): [~tibordigana]I think the problem is the following. Please, open jpms-resource-test1/com.foo.impl/target/test-classes/META-INF/jpms.args: --patch-module com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/java, /home/pavel/Temp/jpms-resource-test1/com.foo.impl/target/generated-sources/annotations As I understand we need to add com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/resources if they exist. Or maybe we should change to com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main . > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153455#comment-17153455 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana]I think the problem is the following. Please, open jpms-resource-test1/com.foo.impl/target/test-classes/META-INF/jpms.args: --patch-module com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/java, /home/pavel/Temp/jpms-resource-test1/com.foo.impl/target/generated-sources/annotations As I understand we need to add com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main/resources if they exist. Or maybe we should change to com.foo.impl=/home/pavel/Temp/jpms-resource-test1/com.foo.impl/src/main . > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153439#comment-17153439 ] Pavel_K edited comment on SUREFIRE-1811 at 7/8/20, 9:42 AM: [~tibordigana]I would say this way: There are these alternatives: 1. main and test without {{module-info}} (classpath) 2. main with {{module-info}}, but test without {{module-info}} (main in modulepath and tests in classpath) 3. main and test on modulepath: # Two modules: one is a main module and the other is a test module with different packages. # One merged module that contains both tests and main classes with same package names. So, I think that 3.2 is the best solution and we need to support it in maven SF and FS was (Author: pavel_k): [~tibordigana]I would say this way: There are these alternatives: 1. main and test without {{module-info}} (classpath) 2. main with {{module-info}}, but test without {{module-info}} (main in modulepath and tests in classpath) 3. main and test on modulepath: # Two modules: one is a main module and the other is a test module with different packages. # One merged module that contains both tests and main classes. So, I think that 3.2 is the best solution and we need to support it in maven SF and FS > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153439#comment-17153439 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana]I would say this way: There are these alternatives: 1. main and test without {{module-info}} (classpath) 2. main with {{module-info}}, but test without {{module-info}} (main in modulepath and tests in classpath) 3. main and test on modulepath: # Two modules: one is a main module and the other is a test module with different packages. # One merged module that contains both tests and main classes. So, I think that 3.2 is the best solution and we need to support it in maven SF and FS > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153417#comment-17153417 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] Do you agree? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153413#comment-17153413 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] >I don't think that two JPMS modules can have the same Java package. IMO it was >not the target to have no restrictions. Yes, that it correct. Look, I think you miss the following thing. There are TWO main approaches for unit testing for jpms module. The first one is that you suggest - we have two descriptors main/java/module-info and test/java/module-info. Every descriptor describes modules with different names (com.foo.impl and com.foo.impl.test). And when we run tests we have two modules. So, nothing difficult here - two simple jpms modules. The second one is that I use (and [~sor] suggests). We again have two descriptors main/java/module-info and test/java/module-info. However, in this case descriptors give THE SAME NAMES to modules (com.foo.impl). How to explain it? It is explained this way - when we run test we have only one module that contains classes from main module and classes from test module. So, we have one merged module (at least as I undesrtand it) with the descriptor from test/java/module-info. Both approaches are correct from JPMS view. However, the second one gives more advantages - see my previous post. And all this issue is about the second approach, but not about the first one. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153291#comment-17153291 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana]No, everything is right. Module com.foo.impl contains only unit tests. So, 1) unit tests are in the same packages as the classes under test (package access) 2) Main module must know nothing about testing module. Your solution suggests 1) creating another module (com.foo.impl.test) 2) changing package name (as we have two different modules and jpms doesn't allow same packages in different modules) 3) explicit opening packages in main module. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17152642#comment-17152642 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] , [~sor] Sorry, for the delay. Here is a full test using ClassGragh [https://github.com/PashaTurok/jpms-resource-test1] It seems, that nor surefire nor failsafe include resources from src/main/resources when we have module-info in src/test/java > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Issue Comment Deleted] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel_K updated SUREFIRE-1811: -- Comment: was deleted (was: [~tibordigana] I have tried to find you in Skype using by your id "tibor.digana", however, when I enter it I see "Invite to Skype" or "Add funds" . Is this correct skype name? By the way I've found finally solutions for unit tests and IT tests on module path. For unit test - I will use the /test/java/module-info.java, for example `open module theSameNameAsMain \{...}` + package names of the unit tests = package names of the module under test. For IT test I will create separate maven projects (using the same parent pom as normal modules of the project). What do you think about such approach?) > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149705#comment-17149705 ] Pavel_K edited comment on SUREFIRE-1811 at 7/2/20, 8:28 AM: [~sor] Do I understand you right - you want to find out if surefire includes resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? was (Author: pavel_k): [~sor] Do I understand you right - you want to find out if surefire include resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149705#comment-17149705 ] Pavel_K edited comment on SUREFIRE-1811 at 7/2/20, 8:28 AM: [~sor] Do I understand you right - you want to find out if surefire include resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? was (Author: pavel_k): [~sor] Do I understand you right - you want to find out if surefire copies resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149705#comment-17149705 ] Pavel_K edited comment on SUREFIRE-1811 at 7/1/20, 9:39 PM: [~sor] Do I understand you right - you want to find out if surefire copies resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? was (Author: pavel_k): [~sor] Do I understand you right - you want to find out it surefire copies resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Issue Comment Deleted] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel_K updated SUREFIRE-1811: -- Comment: was deleted (was: [~tibordigana] Maybe you can advise something as maven expert?) > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149705#comment-17149705 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] Do I understand you right - you want to find out it surefire copies resources from src/main/resources to test module when we use the /test/java/module-info.java, for example `open module theSameNameAsMainModule \{...}` (same name as main module and open for deep reflection)? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Issue Comment Deleted] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel_K updated SUREFIRE-1811: -- Comment: was deleted (was: [~sor] I am trying to find a solution for IT tests and considering module-info.test. What I don't want to do is to create extra subprojects for IT tests as I have a modular maven projects (one parent + jpms modules) and to add there extra module for IT tests is not a good way. I've considered your project here - [https://github.com/sormuras/testing-in-the-modular-world] and have seen that you use nested project in src/it with its own pom.xml. However, my IDE (NetBeans 12) doesn't work with src/it/java and even can't imagine that there can be a nested maven project. I thought about such solution - * unit tests on class path (no module-info in test/java), * module-info.java and module-info.test for IT tests in it/java * IT tests in separate packages in test/java (NB doesn't work with it/java) * patch it/java/module-info.java with packages from test/java using it/java/module-info.test However, as soon as maven finds module-info in it/java it uses this module-info and for test/java. Can this be solved somehow?) > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17149704#comment-17149704 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] I have tried to find you in Skype using by your id "tibor.digana", however, when I enter it I see "Invite to Skype" or "Add funds" . Is this correct skype name? By the way I've found finally solutions for unit tests and IT tests on module path. For unit test - I will use the /test/java/module-info.java, for example `open module theSameNameAsMain \{...}` + package names of the unit tests = package names of the module under test. For IT test I will create separate maven projects (using the same parent pom as normal modules of the project). What do you think about such approach? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148830#comment-17148830 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] Maybe you can advise something as maven expert? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148822#comment-17148822 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] I am trying to find a solution for IT tests and considering module-info.test. What I don't want to do is to create extra subprojects for IT tests as I have a modular maven projects (one parent + jpms modules) and to add there extra module for IT tests is not a good way. I've considered your project here - [https://github.com/sormuras/testing-in-the-modular-world] and have seen that you use nested project in src/it with its own pom.xml. However, my IDE (NetBeans 12) doesn't work with src/it/java and even can't imagine that there can be a nested maven project. I thought about such solution - * unit tests on class path (no module-info in test/java), * module-info.java and module-info.test for IT tests in it/java * IT tests in separate packages in test/java (NB doesn't work with it/java) * patch it/java/module-info.java with packages from test/java using it/java/module-info.test However, as soon as maven finds module-info in it/java it uses this module-info and for test/java. Can this be solved somehow? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147432#comment-17147432 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] Could you take a look at this post https://issues.apache.org/jira/browse/SUREFIRE-1811?focusedCommentId=17147125&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17147125 ? I've read the article [https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world] but still can't find what tools support module-info.test. Could you say how it is possible to use module-info.test of provide link to test project with module-info.test? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147420#comment-17147420 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] Good question. As I've said integration test use only API that must be open to all and mustn't have access to impl module packages. But, this is the ideal situation and the real world is not so ideal. Something like this :) For example in IT test we may need to call initialization logic of the impl with different settings -> we need to open impl package to it module. Sure, we can find solution that will let to avoid it, but can require more work that can't be done at the current moment because of the lack of resources. So, if we are speaking about ideal solution, this solution must provide it. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147418#comment-17147418 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 7:00 PM: - [~cowwoc] > It sounds like you want to be able to define a different descriptor for each > kind of consumer. No. That's wrong.I think the following solution would be ideal: # main module descriptors must be separated from the descriptors of the test modules (that contain tests); # main module descriptors must know nothing about test modules and testing; # main module descriptor can be used both for production and for testing; # IDE and building tools must support this solution. # don't create extra maven projects/subprojects as test modules, I mean use only test/java, it/java inside the main module. The question is how close we can get to it. was (Author: pavel_k): [~cowwoc] > It sounds like you want to be able to define a different descriptor for each > kind of consumer. No. That's wrong.I think the following solution would be ideal: # main module descriptors must be separated from the descriptors of the test modules (that contain tests); # main module descriptors must know nothing about test modules and testing; # main module descriptor can be used both for production and for testing; # IDE and building tools must support this solution. The question is how close we can get to it. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147418#comment-17147418 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 6:57 PM: - [~cowwoc] > It sounds like you want to be able to define a different descriptor for each > kind of consumer. No. That's wrong.I think the following solution would be ideal: # main module descriptors must be separated from the descriptors of the test modules (that contain tests); # main module descriptors must know nothing about test modules and testing; # main module descriptor can be used both for production and for testing; # IDE and building tools must support this solution. The question is how close we can get to it. was (Author: pavel_k): {code:java} // code placeholder {code} [~cowwoc] > It sounds like you want to be able to define a different descriptor for each > kind of consumer. No. That's wrong.I think the following solution would be ideal: # main module descriptors must be separated from the descriptors of the test modules (that contain tests); # main module descriptors must know nothing about test modules and testing; # main module descriptor can be used both for production and for testing; # IDE and building tools must support this solution. The question is how close we can get to it. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147418#comment-17147418 ] Pavel_K commented on SUREFIRE-1811: --- {code:java} // code placeholder {code} [~cowwoc] > It sounds like you want to be able to define a different descriptor for each > kind of consumer. No. That's wrong.I think the following solution would be ideal: # main module descriptors must be separated from the descriptors of the test modules (that contain tests); # main module descriptors must know nothing about test modules and testing; # main module descriptor can be used both for production and for testing; # IDE and building tools must support this solution. The question is how close we can get to it. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147370#comment-17147370 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] > Do your integration tests require access to implementation details (white box > testing)? If so, why? Not, of course not. For example, in IT test JPMS service via interface (that is located in API module) is found (in JPMS env) and tested. > Also, I don't think there is anything wrong with qualified exports. This is > precisely why they were added to JPMS in the first place. I think that "exports something to some-module" was added for giving access to packages to nontest/production modules. We can use this approach for testing, but I can't say it is good. I think this way src/main/java/module-info is descriptor that is used in production, so we shouldn't have there any entries for testing. It is logical, isn't it? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147362#comment-17147362 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 3:25 PM: - [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests) must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious {code:java} module main { exports everything; } {code} was (Author: pavel_k): [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious {code:java} module main { exports everything; } {code} > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was s
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147362#comment-17147362 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 3:21 PM: - [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious {code:java} module main { exports everything; } {code} was (Author: pavel_k): [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious "module main { exports everything}". > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147362#comment-17147362 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 3:20 PM: - [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious "module main { exports everything}". was (Author: pavel_k): [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious "module main { exports everything}" `. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147362#comment-17147362 ] Pavel_K edited comment on SUREFIRE-1811 at 6/28/20, 3:19 PM: - [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious "module main { exports everything}" `. was (Author: pavel_k): [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious `module main { exports everything}`. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147362#comment-17147362 ] Pavel_K commented on SUREFIRE-1811: --- [~cowwoc] When you develop a real JPMS project (that contains N JPMS modules) you should consider many things. # You have API/SPI modules that export almost everything and you have impl modules that try to hide almost everything. The only communication with external world for impl modules are services, that are listed in module-info. # As a rule you test impl modules, and you have two types of tests - units tests and it tests. Both type of tests (and particularly it tests_ must also be in JPMS module and loaded to JPMS layer as they must test module in JPMS environment. # Test module must have its own JPMS settings. For this we use module-info.java or module-info.test (the last one I couldn't make work) # One of the most important task of modularization (-> and JPMS) is to help developer and to provide a mechanism for low coupling between module elements. So, taking all this into consideration we need to think about out testing approach. The simplest way is to export everything in main module - it is simple and it absolutely contradicts modularization principles. Another way is "export something to test-module" - it is better, but anyway is not very good as main module (the module under test) must know nothing about testing module. I am want to find the best way trying to implement different solutions. For example, the link I provided when I opened this issue references to project that uses shadowing of the main module-info and of course this solution contradicts to the most obvious `module main { exports everything}`. > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147125#comment-17147125 ] Pavel_K commented on SUREFIRE-1811: --- [~sor]Thank you for such detailed explanation. I've read your message, I've read this article [https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world] and now I am trying to use test/java/module-info.test for first variant (Single Maven Module Project with Java Module named "com.greetings") . I use NetBeans 12.0, maven compiler plugin 3.8.1, maven-failsafe-plugin 3.0.0-M5. The problem is that it seems that test/java/module-info.test is ignored. Could you say if there is something I have to do to make maven read my module-info.test? Or are there any ways to find out that module-info.test is used? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Issue Comment Deleted] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pavel_K updated SUREFIRE-1811: -- Comment: was deleted (was: [~sor] Thank you very much for such detailed explanation. As I understand in case II (Multi-Module Maven Project with Java Modules named "com.greetings" and "it") you have three module-info. Two module-info.java and one module-info.test. If this is correct, how do you make your IDE (I use NetBeans) work with test/java/module-info.test and test/java/module-info.java at the same time? The first one requires access to all packages of the module under test while the second one only to API packages. Or I understand something wrong?) > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147103#comment-17147103 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] Thank you very much for such detailed explanation. As I understand in case II (Multi-Module Maven Project with Java Modules named "com.greetings" and "it") you have three module-info. Two module-info.java and one module-info.test. If this is correct, how do you make your IDE (I use NetBeans) work with test/java/module-info.test and test/java/module-info.java at the same time? The first one requires access to all packages of the module under test while the second one only to API packages. Or I understand something wrong? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146785#comment-17146785 ] Pavel_K edited comment on SUREFIRE-1811 at 6/27/20, 5:53 AM: - [~sor] How do you think, how many module-info we should have? Two: # main/java/module-info, # test/java/module-info for unit and it tests or three: # main/java/module-info, # test/java/module-info for unit tests # it/java/module-info) for it tests And which of them should have same module names? was (Author: pavel_k): [~sor] How do you think, how many module-info we should have 2 (main/java/module-info, test/java/module-info) or 3 (main/java/module-info, test/java/module-info, it/java/module-info)? And which of them should have same module names? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146785#comment-17146785 ] Pavel_K commented on SUREFIRE-1811: --- [~sor] How do you think, how many module-info we should have 2 (main/java/module-info, test/java/module-info) or 3 (main/java/module-info, test/java/module-info, it/java/module-info)? And which of them should have same module names? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146632#comment-17146632 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] Do you mean that module name in src/main/java/module-info must differ from module name in src/test/java/module-info? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1811) Add resources to JPMS test module
[ https://issues.apache.org/jira/browse/SUREFIRE-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146573#comment-17146573 ] Pavel_K commented on SUREFIRE-1811: --- [~tibordigana] Do you mean that module name in src/main/java/module-info must differ from module name in src/test/java/module-info? > Add resources to JPMS test module > - > > Key: SUREFIRE-1811 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 > Project: Maven Surefire > Issue Type: New Feature > Components: Maven Failsafe Plugin >Affects Versions: 3.0.0-M5 >Reporter: Pavel_K >Priority: Major > > I am testing version 3.0.0-M5 with two module-info in one project - one main > and one for test. My test project is here > https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with > resources. For example, I have src/main/resources/META-INF/persistence.xml > file that is not copied to test module. Because of this it is not possible to > find resource in test module and it is necessary to use something like this > https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 > . > In target/test-classes/META-INF/jpms.args I see: > {code:java} > --patch-module > my.project=/home//hibernate-h2-test4/src/main/java, > /home/.../hibernate-h2-test4/target/generated-sources/annotations > {code} > As I understand test module will NOT contain resources from the module under > test? I mean that test module will NOT contain > /home//hibernate-h2-test4/src/main/resources? > That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146079#comment-17146079 ] Pavel_K commented on SUREFIRE-1733: --- [~sor] I opened a new issue - https://issues.apache.org/jira/browse/SUREFIRE-1811 > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) > [ERROR] at > o
[jira] [Created] (SUREFIRE-1811) Add resources to JPMS test module
Pavel_K created SUREFIRE-1811: - Summary: Add resources to JPMS test module Key: SUREFIRE-1811 URL: https://issues.apache.org/jira/browse/SUREFIRE-1811 Project: Maven Surefire Issue Type: New Feature Components: Maven Failsafe Plugin Affects Versions: 3.0.0-M5 Reporter: Pavel_K I am testing version 3.0.0-M5 with two module-info in one project - one main and one for test. My test project is here https://github.com/PashaTurok/hibernate-h2-test4 . The problem is with resources. For example, I have src/main/resources/META-INF/persistence.xml file that is not copied to test module. Because of this it is not possible to find resource in test module and it is necessary to use something like this https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72 . In target/test-classes/META-INF/jpms.args I see: {code:java} --patch-module my.project=/home//hibernate-h2-test4/src/main/java, /home/.../hibernate-h2-test4/target/generated-sources/annotations {code} As I understand test module will NOT contain resources from the module under test? I mean that test module will NOT contain /home//hibernate-h2-test4/src/main/resources? That's why I suggest to include src/main/resources in test module. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142674#comment-17142674 ] Pavel_K commented on SUREFIRE-1733: --- [~sor]Thank you very much for quick and detailed answer. Yes, you are right, saying "Having said that, and guessing from your issue description, you want to perform "in-module" tests." What about "So, I consider the missing "--patch-module my.project=.../myproject/src/main/resources" a missing feature." - I also think, that this is a missing feature. So, what should I do now? Should I open a new issue? > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at > o
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142661#comment-17142661 ] Pavel_K commented on SUREFIRE-1733: --- Could anyone help me? In target/test-classes/META-INF/jpms.args I see: {code:java} --patch-module my.project=/home//myproject/src/main/java, /home/.../myproject/target/generated-sources/annotations{code} Does it mean, that test module will NOT contain resources from the module under test? I mean that test module will NOT contain /home//myproject/src/main/resources? If yes, then is this a bug or not? > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17142413#comment-17142413 ] Pavel_K commented on SUREFIRE-1733: --- [~tibordigana]I am testing version 3.0.0-M5 with two module-info in one project - one main and one for test. My test project is here [https://github.com/PashaTurok/hibernate-h2-test4] . The problem is with resources. For example, I have src/main/resources/META-INF/persistence.xml file that is not copied to test module. Because of this I can't find resource in test module and use something like this [https://github.com/PashaTurok/hibernate-h2-test4/blob/292e2e683ad72487cbf8d2e5a35dde0d9255001a/src/test/java/com/foo/hibernate/h2/test4/TestIT.java#L72] . Could you say if it is a bug or I understand something wrong? > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apach
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17127430#comment-17127430 ] Pavel_K commented on SUREFIRE-1733: --- [~tibordigana] So must we in src/main/java/module-info explicitly open packages to src/test/java/ module? > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[jira] [Commented] (SUREFIRE-1733) Surefire and Failsafe JPMS additions for JUnit 5.x execution
[ https://issues.apache.org/jira/browse/SUREFIRE-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17120827#comment-17120827 ] Pavel_K commented on SUREFIRE-1733: --- [~tibordigana] Do I understand it right - now, we can add separate module-info for test? I mean this feature is ready to be tested. And could you say when you plan to release [3.0.0-M5|https://issues.apache.org/jira/issues/?jql=project+%3D+SUREFIRE+AND+fixVersion+%3D+3.0.0-M5] ? > Surefire and Failsafe JPMS additions for JUnit 5.x execution > > > Key: SUREFIRE-1733 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1733 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Failsafe Plugin, Maven Surefire Plugin >Affects Versions: 2.22.2, 3.0.0-M4 >Reporter: John Patrick >Assignee: Tibor Digana >Priority: Minor > Fix For: 3.0.0-M5 > > Attachments: surefire-v2.22.2_junit-v5.5.2.txt, > surefire-v2.22.2_junit-v5.6.0-M1.txt, surefire-v3.0.0-M4_junit-v5.5.2.txt, > surefire-v3.0.0-M4_junit-v5.6.0-M1.txt > > > Following on from SUREFIRE-1731 it was highlighted that some projects need > extra '--add-open' options for JUnit to execute correctly, lots have already > been handled or added or supported in previous releases but I'm needing to > add these for a project to run correctly. > I'm happy to start looking at a patch, but need help with where repo or class > to start looking at. > This is what extra arguments I'm needing to pass to surefire/failsafe. > {code} > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=ALL-UNNAMED > --add-opens > ${project.Automatic-Module-Name}/${project.Automatic-Module-Name}=org.junit.platform.commons > --add-opens > org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED > --add-opens > org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED > {code} > Luckly my module names and package names are all on the same standard and > I've got a maven property for each sub module defining what > 'project.Automatic-Module-Name' is. > The 2nd two are probably easy and will work for everyone, the 1st two might > require some discussion and maybe define two variables that surefire and > failsafe can use, one for the module name and one for the package name if > they can dynamically scan the source code and work it out. > This is the stacktrace I'm seeing; > {code} > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on > project PROJECT: There are test failures. > [ERROR] > [ERROR] Please refer to PATH/target/surefire-reports for the individual test > results. > [ERROR] Please refer to dump files (if any exist) [date].dump, > [date]-jvmRun[N].dump and [date].dumpstream. > [ERROR] There was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There > was an error in the forked process > [ERROR] java.lang.IllegalAccessError: class > org.junit.platform.launcher.core.LauncherFactory (in unnamed module > @0x6eceb130) cannot access class > org.junit.platform.commons.util.Preconditions (in module > org.junit.platform.commons) because module org.junit.platform.commons does > not export org.junit.platform.commons.util to unnamed module @0x6eceb130 > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) > [ERROR] at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) > [ERROR] at > org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) > [ERROR] at > org.apache.maven.lifecycle.in
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17111235#comment-17111235 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] I don't have any problems: {code:java} pavel@pc1:~/Temp$ java -version openjdk version "14" 2020-03-17 OpenJDK Runtime Environment (build 14+36-1461) OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing) pavel@pc1:~/Temp$ git clone https://github.com/apache/maven-surefire.git Cloning into 'maven-surefire'... remote: Enumerating objects: 808, done. remote: Counting objects: 100% (808/808), done. remote: Compressing objects: 100% (441/441), done. remote: Total 70097 (delta 194), reused 602 (delta 115), pack-reused 69289 Receiving objects: 100% (70097/70097), 12.55 MiB | 2.36 MiB/s, done. Resolving deltas: 100% (23491/23491), done. pavel@pc1:~/Temp$ cd maven-surefire pavel@pc1:~/Temp/maven-surefire$ pavel@pc1:~/Temp/maven-surefire$ mvn install -DskipTests -nsu [INFO] Reactor Summary for Apache Maven Surefire 3.0.0-SNAPSHOT: [INFO] [INFO] Apache Maven Surefire .. SUCCESS [ 9.445 s] [INFO] SureFire Logger API SUCCESS [ 4.226 s] [INFO] SureFire API ... SUCCESS [ 5.182 s] [INFO] Surefire Extensions API SUCCESS [ 2.361 s] [INFO] Surefire Extensions SPI SUCCESS [ 1.110 s] [INFO] SureFire Booter SUCCESS [ 5.290 s] [INFO] Maven Surefire Test-Grouping Support ... SUCCESS [ 2.872 s] [INFO] SureFire Providers . SUCCESS [ 0.451 s] [INFO] Shared JUnit3 Provider Code SUCCESS [ 1.925 s] [INFO] Shared Java 5 Provider Base SUCCESS [ 2.399 s] [INFO] Shared JUnit4 Provider Code SUCCESS [ 2.473 s] [INFO] Shared JUnit48 Provider Code ... SUCCESS [ 2.877 s] [INFO] SureFire JUnit Runner .. SUCCESS [ 2.162 s] [INFO] SureFire JUnit4 Runner . SUCCESS [ 2.071 s] [INFO] Maven Surefire Common .. SUCCESS [ 9.952 s] [INFO] SureFire JUnitCore Runner .. SUCCESS [ 5.007 s] [INFO] SureFire JUnit Platform Runner . SUCCESS [ 4.309 s] [INFO] SureFire TestNG Utils .. SUCCESS [ 2.166 s] [INFO] SureFire TestNG Runner . SUCCESS [ 2.967 s] [INFO] ShadeFire JUnit3 Provider .. SUCCESS [ 1.249 s] [INFO] Surefire Report Parser . SUCCESS [ 2.975 s] [INFO] Maven Surefire Plugin .. SUCCESS [ 5.779 s] [INFO] Maven Failsafe Plugin .. SUCCESS [ 4.652 s] [INFO] Maven Surefire Report Plugin ... SUCCESS [ 6.318 s] [INFO] Maven Surefire Integration Tests ... SUCCESS [ 5.776 s] [INFO] Surefire Shared Utils .. SUCCESS [ 0.946 s] [INFO] [INFO] BUILD SUCCESS [INFO] [INFO] Total time: 01:37 min [INFO] Finished at: 2020-05-19T17:29:34+03:00 pavel@pc1:~/Temp/maven-surefire$ cd surefire-its/src/test/resources/surefire-1570 pavel@pc1:~/Temp/maven-surefire/surefire-its/src/test/resources/surefire-1570$ pavel@pc1:~/Temp/maven-surefire/surefire-its/src/test/resources/surefire-1570$ mvn verify -nsu -Dsurefire.version=3.0.0-SNAPSHOT ... [INFO] --- maven-surefire-plugin:3.0.0-SNAPSHOT:test (default-test) @ com.foo.impl --- [INFO] [INFO] --- [INFO] T E S T S [INFO] --- [INFO] Running com.foo.impl.BarTest [main] INFO com.foo.impl.BarTest - ==UNIT TEST=== ... [main] INFO com.foo.impl.Bar - [main] INFO com.foo.impl.Bar - Let's see if I or SLF4J are among boot layer modules: true [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.084 s - in com.foo.impl.BarTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] [INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ com.foo.impl --- [INFO] Building jar: /home/pavel/Temp/maven-surefire/surefire-its/src/test/resources/surefire-1570/com.foo.impl/target/com.foo.impl-1.0.0.jar [INFO] [INFO] --- maven-failsafe-plugin:3.0.0-SNAPSHOT:integration-test (integration-tests) @ com.foo.impl --- [INFO] [INFO] --- [INFO] T E S T S [INFO] --- [INFO] Running com.foo.impl.BarIT [main] INFO com.foo.impl.BarIT - ==INTEGRATIO
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110158#comment-17110158 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Yes, my package visibility problem is described here https://issues.apache.org/jira/browse/SUREFIRE-1733 . Thank you very much for your help and the link. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn > module java.security.jgss > module jdk.localedata > module java.desktop > module jdk.zipfs > module jdk.jshell > module oracle.desktop > module jdk.int
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110141#comment-17110141 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] I had two questions: 1) about package visibility 2) about Junit4 runner. I asked these two questions one by one. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn > module java.security.jgss > module jdk.localedata > module java.desktop > module jdk.zipfs > module jdk.jshell > module oracle.desktop > module jdk.internal.ed > module java.security.sasl > mod
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110090#comment-17110090 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Could you then explain what I should do if I want import org.junit.platform.runner.JUnitPlatform; import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.SuiteDisplayName; import org.junit.runner.RunWith; @RunWith(JUnitPlatform.class) @SuiteDisplayName("JUnit Platform Suite Demo") @SelectPackages("example") public class JUnitPlatformSuiteDemo { } as it it explained [here |https://junit.org/junit5/docs/current/user-guide/#running-tests-junit-platform-runner-test-suite]. Without that dependency I can't compile project. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.sma
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110080#comment-17110080 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Besides, I noted if you add to [https://github.com/apache/maven-surefire/blob/13ff5483f591662143f40014bb5f2e7556c9557f/surefire-its/src/test/resources/surefire-1570/com.foo.impl/pom.xml] the following dependency: {code:java} org.junit.platform junit-platform-runner 1.6.2 test {code} Then test won't be run anymore. But if I need this dependency, for example for running suites? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.manage
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17109986#comment-17109986 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana]Thank you very much for solving this issue and your answer. Now I am testing how it works and have the following queston - if you comment this line [https://github.com/apache/maven-surefire/blob/13ff5483f591662143f40014bb5f2e7556c9557f/surefire-its/src/test/resources/surefire-1570/com.foo.impl/src/main/java/module-info.java#L24] , you will get: {code:java} java.lang.reflect.InaccessibleObjectException: Unable to make void com.foo.impl.BarTest.shouldPrintModulePath() accessible: module com.foo.impl does not "opens com.foo.impl" to unnamed module @68567e20{code} So, if we want to run it tests we must open the package where it is located. And as the module has no name we need to open package to all modules? As a workaround it is possible to place it tests in separate packages and open them, but it is not good. Or I don't understand something? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17109645#comment-17109645 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] I've seen that you resolved this issue and wanted to test it. I compiled plugins from master and did {code:java} git clone https://github.com/PashaTurok/plugin-jpms cd plugin-jpms mvn clean install {code} However, no one of my test run - neither unit, nor integration. Do I do something wrong? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn > module
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092282#comment-17092282 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] Of course. But that project I deleted already. Take [this one|https://github.com/PashaTurok/plugin-jpms] that includes both unit and integration tests. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092277#comment-17092277 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Thank you very much for your explanation as I thought I am getting crazy (so many days in quarantine). Now I know, that: # You know that it doesn't work. # You did it intentionally. # You know where the problem is. # You are going to shoot two issues with one bullet. Ok. That's good news. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn > module java.security.jgss > module jdk.localedata
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092251#comment-17092251 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Ok. I see. If you have 1-2 free minutes, could you run the following commands: {code:java} git clone https://github.com/PashaTurok/plugin-jpms cd plugin-jpms mvn clean install {code} and see the output of surefire and failsafe plugins for module - com.foo.plugin. Please, just take a look. I don't know why they give different outputs if they are same. Maybe I do something wrong. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module j
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092227#comment-17092227 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] To tell the truth I understood nothing. Why do you think this issue is about multi-release versions? I opened it and I don't remember I meant something like this. Still can't understand why my IT tests with failsafe doesn't run on module-path. Or lets start from the beginning - I prepare project and we will try to run its IT tests. Agree? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn >
[jira] [Comment Edited] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092221#comment-17092221 ] Pavel_K edited comment on SUREFIRE-1570 at 4/25/20, 12:55 PM: -- [~tibordigana] Why when do I run my IT tests this way: {code:java} org.apache.maven.plugins maven-failsafe-plugin 3.0.0-M4 integration-tests integration-test verify ${skip.integration.tests} {code} They are not on module-path? Module-path does work with surefire, why not with failsafe? was (Author: pavel_k): [~tibordigana] Why when do I run my IT tests this way: org.apache.maven.plugins maven-failsafe-plugin 3.0.0-M4 integration-tests integration-test verify ${skip.integration.tests} They are not on module-path? Module-path does work with surefire, why not with failsafe? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092221#comment-17092221 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] Why when do I run my IT tests this way: org.apache.maven.plugins maven-failsafe-plugin 3.0.0-M4 integration-tests integration-test verify ${skip.integration.tests} They are not on module-path? Module-path does work with surefire, why not with failsafe? > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml
[jira] [Commented] (SUREFIRE-1780) Print JPMS errors from native stream of the fork JVM
[ https://issues.apache.org/jira/browse/SUREFIRE-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092204#comment-17092204 ] Pavel_K commented on SUREFIRE-1780: --- [~tibordigana] Thank you very much! Finally I could run my tests on module path for my real project. So, what about failsafe? What don't you add the same module-path support for it. Or I don't understand something? > Print JPMS errors from native stream of the fork JVM > > > Key: SUREFIRE-1780 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1780 > Project: Maven Surefire > Issue Type: Improvement > Components: process forking > Environment: Java 9+ >Reporter: Tibor Digana >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > > When JVM prints own logs to the native stream, the surefire stream becomes > corrupted. These are printed in a dump file and they are supposed a stream > corruption. We can extract some special logs from this corrupted stream. > This issue is based on the last discussion in SUREFIRE-1262. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (SUREFIRE-1780) Print JPMS errors from native stream of the fork JVM
[ https://issues.apache.org/jira/browse/SUREFIRE-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092185#comment-17092185 ] Pavel_K edited comment on SUREFIRE-1780 at 4/25/20, 11:27 AM: -- [~tibordigana] I have seen that you fixed this issue, so I've cloned the project from github, built it and now try to run my test this way: {code:java} org.apache.maven.plugins maven-surefire-plugin 3.0.0-SNAPSHOT {code} I get this {code:java} Command was /bin/sh -c cd /home/pavel/Temp/surefire-jpms/com.foo.plugin && /opt/jdk-14/bin/java @/home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire/surefireargs1141888352115027119 /home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire 2020-04-25T14-15-05_097-jvmRun1 surefire16724086776763298357tmp surefire_04817899869263360950tmp Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork (ForkStarter.java:748) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run (ForkStarter.java:305) {code} But the problem is there is no surefire-reports folder in target: {code:java} pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ pwd /home/pavel/Temp/surefire-jpms/com.foo.plugin/target pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ ls classes generated-sources generated-test-sources maven-status test-classes {code} Do I do something wrong? was (Author: pavel_k): [~tibordigana] I have seen that you fixed this issue, so I've cloned the project from github, built it and now try to run my test this way: {code:java} org.apache.maven.plugins maven-surefire-plugin 3.0.0-SNAPSHOT {code} I get this {code:java} Command was /bin/sh -c cd /home/pavel/Temp/surefire-jpms/com.foo.plugin && /opt/jdk-14/bin/java @/home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire/surefireargs1141888352115027119 /home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire 2020-04-25T14-15-05_097-jvmRun1 surefire16724086776763298357tmp surefire_04817899869263360950tmp Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork (ForkStarter.java:748) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run (ForkStarter.java:305) {code} But the problem is there is no surefire folder in target: {code:java} pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ pwd /home/pavel/Temp/surefire-jpms/com.foo.plugin/target pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ ls classes generated-sources generated-test-sources maven-status test-classes {code} Do I do something wrong? > Print JPMS errors from native stream of the fork JVM > > > Key: SUREFIRE-1780 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1780 > Project: Maven Surefire > Issue Type: Improvement > Components: process forking > Environment: Java 9+ >Reporter: Tibor Digana >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > > When JVM prints own logs to the native stream, the surefire stream becomes > corrupted. These are printed in a dump file and they are supposed a stream > corruption. We can extract some special logs from this corrupted stream. > This issue is based on the last discussion in SUREFIRE-1262. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1780) Print JPMS errors from native stream of the fork JVM
[ https://issues.apache.org/jira/browse/SUREFIRE-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092185#comment-17092185 ] Pavel_K commented on SUREFIRE-1780: --- [~tibordigana] I have seen that you fixed this issue, so I've cloned the project from github, built it and now try to run my test this way: {code:java} org.apache.maven.plugins maven-surefire-plugin 3.0.0-SNAPSHOT {code} I get this {code:java} Command was /bin/sh -c cd /home/pavel/Temp/surefire-jpms/com.foo.plugin && /opt/jdk-14/bin/java @/home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire/surefireargs1141888352115027119 /home/pavel/Temp/surefire-jpms/com.foo.plugin/target/surefire 2020-04-25T14-15-05_097-jvmRun1 surefire16724086776763298357tmp surefire_04817899869263360950tmp Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork (ForkStarter.java:748) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run (ForkStarter.java:305) {code} But the problem is there is no surefire folder in target: {code:java} pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ pwd /home/pavel/Temp/surefire-jpms/com.foo.plugin/target pavel@pc1:~/Temp/surefire-jpms/com.foo.plugin/target$ ls classes generated-sources generated-test-sources maven-status test-classes {code} Do I do something wrong? > Print JPMS errors from native stream of the fork JVM > > > Key: SUREFIRE-1780 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1780 > Project: Maven Surefire > Issue Type: Improvement > Components: process forking > Environment: Java 9+ >Reporter: Tibor Digana >Assignee: Tibor Digana >Priority: Major > Fix For: 3.0.0-M5 > > > When JVM prints own logs to the native stream, the surefire stream becomes > corrupted. These are printed in a dump file and they are supposed a stream > corruption. We can extract some special logs from this corrupted stream. > This issue is based on the last discussion in SUREFIRE-1262. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1570) Maven-fail-safe doesn't put testing JPMS module on module path
[ https://issues.apache.org/jira/browse/SUREFIRE-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092146#comment-17092146 ] Pavel_K commented on SUREFIRE-1570: --- [~tibordigana] I will be glad to help, but as I said I don't know maven plugins work and now have no time to do it now. What I can is to test, to debug, to give comments from jpms point of view. I can create simple jpms project with services we could start. > Maven-fail-safe doesn't put testing JPMS module on module path > -- > > Key: SUREFIRE-1570 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1570 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Failsafe Plugin >Affects Versions: 2.22.0 >Reporter: Pavel_K >Priority: Major > Fix For: 3.0.0-M5 > > Attachments: mavenproject20.zip > > > I uploaded project - mavenproject20. Run `mvn verify`. You will see the > following: > {code:java} > [INFO] Scanning for projects... > [INFO] > > [INFO] > > [INFO] Building mavenproject20 0.1.0-SNAPSHOT > [INFO] > > [INFO] > [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] Copying 0 resource > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ > mavenproject20 --- > [WARNING] > > [WARNING] * Required filename-based automodules detected. Please don't > publish this project to a public artifact repository! * > [WARNING] > > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 3 source files to > /home/Jim/NetBeansProjects/mavenproject20/target/classes > [WARNING] > /home/Jim/NetBeansProjects/mavenproject20/src/main/java/module-info.java:[1,8] > module name component Mavenproject20 should avoid terminal digits > [INFO] > [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ > mavenproject20 --- > [INFO] Using 'UTF-8' encoding to copy filtered resources. > [INFO] skip non existing resourceDirectory > /home/Jim/NetBeansProjects/mavenproject20/src/test/resources > [INFO] > [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ > mavenproject20 --- > [INFO] Changes detected - recompiling the module! > [INFO] Compiling 1 source file to > /home/Jim/NetBeansProjects/mavenproject20/target/test-classes > [INFO] > [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ mavenproject20 > --- > [INFO] > [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ mavenproject20 --- > [INFO] Building jar: > /home/Jim/NetBeansProjects/mavenproject20/target/mavenproject20-0.1.0-SNAPSHOT.jar > [INFO] > [INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) > @ mavenproject20 --- > [INFO] > [INFO] --- > [INFO] T E S T S > [INFO] --- > [INFO] Running me.pavel.mavenproject20.ServiceIT > JDKModulePath:null > ModuleName:null > module jdk.unsupported > module jdk.sctp > module java.naming > module java.jnlp > module jdk.httpserver > module java.xml > module javafx.controls > module java.datatransfer > module jdk.javadoc > module jdk.jconsole > module java.instrument > module jdk.packager > module jdk.deploy > module jdk.jfr > module jdk.management > module jdk.charsets > module oracle.net > module jdk.jdeps > module java.sql.rowset > module jdk.net > module jdk.accessibility > module jdk.attach > module jdk.internal.le > module jdk.snmp > module java.base > module jdk.plugin > module jdk.dynalink > module jdk.naming.rmi > module jdk.internal.opt > module java.management.rmi > module jdk.management.jfr > module javafx.swing > module jdk.editpad > module jdk.crypto.ec > module jdk.javaws > module jdk.jstatd > module jdk.management.agent > module javafx.graphics > module javafx.media > module java.rmi > module java.prefs > module jdk.security.jgss > module javafx.fxml > module java.smartcardio > module jdk.xml.dom > module java.xml.crypto > module jdk.jsobject > module jdk.jdi > module jdk.compiler > module java.management > module jdk.management.cmm > module jdk.packager.services > module jdk.jartool > module jdk.scripting.nashorn > module java.security.jgss > module jdk.localedata > module java.desktop > module jdk.zipfs > modul
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091886#comment-17091886 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] Answering to your suggestion: {quote}Maybe what we can do for you more is to print these errors as soon as the JVM corrupts the native stream with: Error occurred during initialization of boot layer java.lang.module.FindException: Module java.ws.rs not found, required by com.foo.api{quote} I think it is absolutely necessary. There can be tens and hundreds dependencies so it is simple not possible to work without it. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091500#comment-17091500 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] Thank you for your clarification. I am not maven expert, so I asked a question on SO [here|https://stackoverflow.com/questions/61407603/]. Please, see if I explained everything right in it. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17091253#comment-17091253 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] You said that you fixed my problem by adding to com.foo.api the following code: {code:java} javax.xml.bind jaxb-api 2.3.1 javax.ws.rs javax.ws.rs-api 2.1.1 {code} Ok, lets see. For simplicity let's throw out java.persistence. This is module-info of com.foo.api {code:java} module com.foo.api { requires org.slf4j; requires java.ws.rs; requires java.xml.bind; } {code} In pom of com.foo.api we have: {code:java} org.slf4j slf4j-api jakarta.ws.rs jakarta.ws.rs-api jakarta.xml.bind jakarta.xml.bind-api {code} In slf4j-api-1.8.0-beta2.jar there is a module-info: module org.slf4j { } In jakarta.ws.rs-api-2.1.6.jar there is a module-info: module java.ws.rs {...} In jakarta.xml.bind-api-2.3.2.jar there is a module-info: module java.xml.bind {...} So, trying to build foo project I get: {code:java} Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on project com.foo.plugin: There are test failures. Error occurred in starting fork, check output in log Process Exit Code: 1 org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called? Error occurred in starting fork, check output in log Process Exit Code: 1 at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:690) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:248) {code} Say, please, do you still think that my code is not correct and it is necessary to add the dependencies that you listed OR the problem is in surefire plugin? To tell the truth it is the third day while we are talking and only same talks. So, let's understand either we fix something or stop talking. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090783#comment-17090783 ] Pavel_K commented on SUREFIRE-1262: --- [~rfscholte] I wouldn't advice to put all modules on module-path as there are a lot of libraries that don't work well there. Put only those that are required in module-info of the module that is being tested and in module-info of its dependencies. Let's think this way - on module path we put only those jar that either have module-info or are required in module-info (so some module is going to use it as automatic module). For example, foo.jar has module-info and requires bar.jar. Bar.jar doesn't have module-info and it uses baz.jar. Baz.jar doesn't have module-info. So, foo.jar (explicit module), bar.jar (automatic module) are on module-path, baz is on class-path (unnamed module). > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090567#comment-17090567 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] `The dump files are produced by the JVM, saying: Error occurred during initialization of boot layer java.lang.module.FindException: Module java.xml.bind not found, required by com.foo.api It looks like we are missing the JAXB library.` Maybe you are right. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090566#comment-17090566 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] What do you think about #1 here https://issues.apache.org/jira/browse/SUREFIRE-1262?focusedCommentId=17090549&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17090549 ? > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090565#comment-17090565 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] This is my report ~/Temp/surefire-jpms/com.foo.plugin/target/surefire-reports$ cat 2020-04-23T15-09-06_657-jvmRun1.dumpstream # Created at 2020-04-23T15:09:07.825 Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'Error occurred during initialization of boot layer'. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090549#comment-17090549 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] And two moments more 1) if the code you provided above is about compiling `com.foo.plugin` then I think this is wrong: --module-path ... C:\\vcs\\github\\surefire-jpms\\com.foo.api\\target\\classes;... I think it must be reference to com.foo.api in maven repo. 2) You wrote "i haven't noticed Automatic-Module-Name in the manifest file". It is not important if module has or hasn't `Automatic-Module-Name` in manifest. If you add plain jar (with it without such entry in manifest) to module-path it will become automatic module. The difference will be only in a way how JPMS will define name for it. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090529#comment-17090529 ] Pavel_K commented on SUREFIRE-1262: --- So, one by one 1) --module-path ... C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\classes; - I don't know if it is correct. I worked only with jars and directories containing jars, but if it works... 2) --class-path ... C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\test-classes; --patch-module com.foo.plugin="C:\\vcs\\github\\surefire-jpms\\com.foo.plugin\\target\\test-classes" Maybe we need to leave only `--patch-module`? Or it doesn't work if they are not on class path? 3) --add-modules com.foo.plugin .. to tell the truth I don't understand it. We do have it on module path, see #1. 4) I would also try to add --add-opens com.foo.plugin/com.foo.plugin=ALL-UNNAMED If my notes don't help, you can ask about best JPMS configuration for unit testing in jigsaw-dev mailing list. They give very good answers. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090436#comment-17090436 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] No, I think that is not correct. 1) Try to remove all `requires` in API module-info and add to API the following class: @Entity public class User {}. If you don't add `requires java.persistence` you will get `package javax.persistence is not visible (package javax.persistence is declared in module java.persistence, but module com.foo.api does not read` compilation error. 2) why do you think that javax.persistence-api-2.2.jar is unnamed module? Take a look at its manifest and you will see `Automatic-Module-Name: java.persistence`. 3) It seems that you think if there is no module-info it must be on classpath. No, we can take any jar (without module-info), put it on module-path and use it as usual module. JPMS will create from such `plain jar` automatic module. Automatic modules are plain JARs (no module descriptor) on the module path. Automatic modules ARE NOT unnamed modules. Automatic Modules – We can include unofficial modules by adding existing JAR files to the module path. The name of the module will be derived from the name of the JAR. Automatic modules will have full read access to every other module loaded by the path. Unnamed Module – When a class or JAR is loaded onto the classpath, but not the module path, it's automatically added to the unnamed module. It's a catch-all module to maintain backward compatibility with previously-written Java code. Take a look here https://stackoverflow.com/a/46742802/5057736 So, it seems my code is right, by surefire has problems with automatic modules. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090076#comment-17090076 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] I think that com.foo.plugin is tested if it doesn't use com.foo.api. And the problem in com.foo.api is in module-info - try to remove all `requires` except slf4j. Hope it will help. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090061#comment-17090061 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] What about your question - could explain what you mean `ClassLoader in Java 11` can recognize module path by itself? Maybe you will find answer in Alan's answer to this question https://stackoverflow.com/questions/61195909/what-is-the-relation-between-modulelayer-and-classloader > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090055#comment-17090055 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] I found out why I added forkCount. Here is almost empty project. Please, do the following: git clone https://github.com/PashaTurok/surefire-jpms.git, mvn clean install. I added forkCount=0 because it doesn't work without it, however, when I add forkCount=0 I can't use module path. > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (SUREFIRE-1262) Add modulepath support
[ https://issues.apache.org/jira/browse/SUREFIRE-1262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17090028#comment-17090028 ] Pavel_K commented on SUREFIRE-1262: --- [~tibordigana] Wow it seems to work. But in real project I had to add forkCount=0 because it gave an error (I will say later). However, when I run test it requires me to open com.foo.plugin. I think this is a bad way - we don't need to open the packages we test. Have you tried to open all packages automatically for testing using this method https://docs.oracle.com/javase/9/docs/api/java/lang/Module.html#addOpens-java.lang.String-java.lang.Module- ? > Add modulepath support > -- > > Key: SUREFIRE-1262 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1262 > Project: Maven Surefire > Issue Type: Improvement >Reporter: Robert Scholte >Assignee: Tibor Digana >Priority: Major > Fix For: 2.21.0 > > > With the Jigsaw project Java9 is extended with a modulepath. This means that > surefire should be executed in a different way. > When working with a modulepath, the Classpath in the MANIFEST of the > executable jar will be ignored, you need need to add everything on > commandline. > Just like javadoc, the java executable has an {{@}} option, where you > can add arguments per line. So this is the new preferred way to build the > module-path. > IIUC for surefire it is important to add {{--patch-module > target/test-classes}} (was: -Xpatch) which makes it possible to use the same > packages as target/classes. -- This message was sent by Atlassian Jira (v8.3.4#803005)