Re: Surefire plugin with multi-release?
Well this escalated quickly :) Now to find some time to look at this. I'll pull the plugin code later On 6 Apr 2019, at 19:52, Tibor Digana wrote: > Mark, do not forget to update documentation with certain usecase(s). > Configure your tool (prefer IntelliJ IDEA) with code style, see the > instructions in > https://maven.apache.org/developers/conventions/code.html# > IntelliJ_IDEA_4.5.2B > and download https://maven.apache.org/developers/maven-idea-codestyle.xml --- "The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." Mark Reinhold. Mark Derricutt http://www.theoryinpractice.net http://www.chaliceofblood.net http://plus.google.com/+MarkDerricutt http://twitter.com/talios http://facebook.com/mderricutt signature.asc Description: OpenPGP digital signature
Re: Surefire plugin with multi-release?
the XML works with IDEA 14 (not higher). Feel free to update the codestyle XML for IDEA 18+. On Sat, Apr 6, 2019 at 8:52 AM Tibor Digana wrote: > Mark, do not forget to update documentation with certain usecase(s). > Configure your tool (prefer IntelliJ IDEA) with code style, see the > instructions in > https://maven.apache.org/developers/conventions/code.html# > IntelliJ_IDEA_4.5.2B > and download https://maven.apache.org/developers/maven-idea-codestyle.xml > > On Sat, Apr 6, 2019 at 8:48 AM Tibor Digana > wrote: > >> Mark, provide a patch including the unit tests in pull request on GitHub. >> We are spending the time with tasks related to our long standing plan. >> >> On Fri, Apr 5, 2019 at 10:35 AM Robert Scholte >> wrote: >> >>> I think what Mark means is a jdkToolchain parameter[1] like >>> maven-compiler-plugin. >>> This way you can execute with several different toolchains within the >>> same >>> Maven run. >>> To me it makes sense to add that to surefire/failsafe >>> >>> Robert >>> >>> [1] >>> >>> https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#jdkToolchain >>> >>> On Thu, 04 Apr 2019 23:54:38 +0200, Tibor Digana >>> >>> wrote: >>> >>> > You can use Toolchain with Failsafe plugin: >>> > https://maven.apache.org/surefire/maven-surefire-plugin/java9.html >>> > but you can configure multiple executions and phases for the >>> > maven-toolchains-plugin. >>> > >>> > On Thu, Apr 4, 2019 at 11:09 PM Mark Derricutt >>> wrote: >>> > >>> >> On 5 Apr 2019, at 6:29, Robert Scholte wrote: >>> >> >>> >> If you want to test the jar, you must use the failsafe plugin (or bind >>> >> surefire to the integration-test phase) >>> >> >>> >> Can/could failsafe take a toolchain id as config, then you could >>> >> configure >>> >> additional executions using each toolchain you wanted? >>> >> -- >>> >> >>> >> "The ease with which a change can be implemented has no relevance at >>> all >>> >> to whether it is the right change for the (Java) Platform for all >>> >> time." — >>> >> Mark Reinhold. >>> >> >>> >> Mark Derricutt >>> >> http://www.theoryinpractice.net >>> >> http://www.chaliceofblood.net >>> >> http://plus.google.com/+MarkDerricutt >>> >> http://twitter.com/talios >>> >> http://facebook.com/mderricutt >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >>> For additional commands, e-mail: users-h...@maven.apache.org >>> >>>
Re: Surefire plugin with multi-release?
Mark, do not forget to update documentation with certain usecase(s). Configure your tool (prefer IntelliJ IDEA) with code style, see the instructions in https://maven.apache.org/developers/conventions/code.html# IntelliJ_IDEA_4.5.2B and download https://maven.apache.org/developers/maven-idea-codestyle.xml On Sat, Apr 6, 2019 at 8:48 AM Tibor Digana wrote: > Mark, provide a patch including the unit tests in pull request on GitHub. > We are spending the time with tasks related to our long standing plan. > > On Fri, Apr 5, 2019 at 10:35 AM Robert Scholte > wrote: > >> I think what Mark means is a jdkToolchain parameter[1] like >> maven-compiler-plugin. >> This way you can execute with several different toolchains within the >> same >> Maven run. >> To me it makes sense to add that to surefire/failsafe >> >> Robert >> >> [1] >> >> https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#jdkToolchain >> >> On Thu, 04 Apr 2019 23:54:38 +0200, Tibor Digana >> >> wrote: >> >> > You can use Toolchain with Failsafe plugin: >> > https://maven.apache.org/surefire/maven-surefire-plugin/java9.html >> > but you can configure multiple executions and phases for the >> > maven-toolchains-plugin. >> > >> > On Thu, Apr 4, 2019 at 11:09 PM Mark Derricutt wrote: >> > >> >> On 5 Apr 2019, at 6:29, Robert Scholte wrote: >> >> >> >> If you want to test the jar, you must use the failsafe plugin (or bind >> >> surefire to the integration-test phase) >> >> >> >> Can/could failsafe take a toolchain id as config, then you could >> >> configure >> >> additional executions using each toolchain you wanted? >> >> -- >> >> >> >> "The ease with which a change can be implemented has no relevance at >> all >> >> to whether it is the right change for the (Java) Platform for all >> >> time." — >> >> Mark Reinhold. >> >> >> >> Mark Derricutt >> >> http://www.theoryinpractice.net >> >> http://www.chaliceofblood.net >> >> http://plus.google.com/+MarkDerricutt >> >> http://twitter.com/talios >> >> http://facebook.com/mderricutt >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >>
Re: Surefire plugin with multi-release?
Mark, provide a patch including the unit tests in pull request on GitHub. We are spending the time with tasks related to our long standing plan. On Fri, Apr 5, 2019 at 10:35 AM Robert Scholte wrote: > I think what Mark means is a jdkToolchain parameter[1] like > maven-compiler-plugin. > This way you can execute with several different toolchains within the > same > Maven run. > To me it makes sense to add that to surefire/failsafe > > Robert > > [1] > > https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#jdkToolchain > > On Thu, 04 Apr 2019 23:54:38 +0200, Tibor Digana > > wrote: > > > You can use Toolchain with Failsafe plugin: > > https://maven.apache.org/surefire/maven-surefire-plugin/java9.html > > but you can configure multiple executions and phases for the > > maven-toolchains-plugin. > > > > On Thu, Apr 4, 2019 at 11:09 PM Mark Derricutt wrote: > > > >> On 5 Apr 2019, at 6:29, Robert Scholte wrote: > >> > >> If you want to test the jar, you must use the failsafe plugin (or bind > >> surefire to the integration-test phase) > >> > >> Can/could failsafe take a toolchain id as config, then you could > >> configure > >> additional executions using each toolchain you wanted? > >> -- > >> > >> "The ease with which a change can be implemented has no relevance at all > >> to whether it is the right change for the (Java) Platform for all > >> time." — > >> Mark Reinhold. > >> > >> Mark Derricutt > >> http://www.theoryinpractice.net > >> http://www.chaliceofblood.net > >> http://plus.google.com/+MarkDerricutt > >> http://twitter.com/talios > >> http://facebook.com/mderricutt > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: Surefire plugin with multi-release?
I think what Mark means is a jdkToolchain parameter[1] like maven-compiler-plugin. This way you can execute with several different toolchains within the same Maven run. To me it makes sense to add that to surefire/failsafe Robert [1] https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#jdkToolchain On Thu, 04 Apr 2019 23:54:38 +0200, Tibor Digana wrote: You can use Toolchain with Failsafe plugin: https://maven.apache.org/surefire/maven-surefire-plugin/java9.html but you can configure multiple executions and phases for the maven-toolchains-plugin. On Thu, Apr 4, 2019 at 11:09 PM Mark Derricutt wrote: On 5 Apr 2019, at 6:29, Robert Scholte wrote: If you want to test the jar, you must use the failsafe plugin (or bind surefire to the integration-test phase) Can/could failsafe take a toolchain id as config, then you could configure additional executions using each toolchain you wanted? -- "The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." — Mark Reinhold. Mark Derricutt http://www.theoryinpractice.net http://www.chaliceofblood.net http://plus.google.com/+MarkDerricutt http://twitter.com/talios http://facebook.com/mderricutt - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Surefire plugin with multi-release?
You can use Toolchain with Failsafe plugin: https://maven.apache.org/surefire/maven-surefire-plugin/java9.html but you can configure multiple executions and phases for the maven-toolchains-plugin. On Thu, Apr 4, 2019 at 11:09 PM Mark Derricutt wrote: > On 5 Apr 2019, at 6:29, Robert Scholte wrote: > > If you want to test the jar, you must use the failsafe plugin (or bind > surefire to the integration-test phase) > > Can/could failsafe take a toolchain id as config, then you could configure > additional executions using each toolchain you wanted? > -- > > "The ease with which a change can be implemented has no relevance at all > to whether it is the right change for the (Java) Platform for all time." — > Mark Reinhold. > > Mark Derricutt > http://www.theoryinpractice.net > http://www.chaliceofblood.net > http://plus.google.com/+MarkDerricutt > http://twitter.com/talios > http://facebook.com/mderricutt >
Re: Surefire plugin with multi-release?
On 5 Apr 2019, at 6:29, Robert Scholte wrote: > If you want to test the jar, you must use the failsafe plugin (or bind > surefire to the integration-test phase) Can/could failsafe take a toolchain id as config, then you could configure additional executions using each toolchain you wanted? --- "The ease with which a change can be implemented has no relevance at all to whether it is the right change for the (Java) Platform for all time." Mark Reinhold. Mark Derricutt http://www.theoryinpractice.net http://www.chaliceofblood.net http://plus.google.com/+MarkDerricutt http://twitter.com/talios http://facebook.com/mderricutt signature.asc Description: OpenPGP digital signature
Re: Surefire plugin with multi-release?
My experience is that most people are application developers and MR JARS are meant for libraries, not applications. And even for libraries you often don't need to turn it into a MRJAR. Only for those "special" libraries it might make sense, but I consider these specials and their developers are often Java specialists. I would expect from them to understand the requirements and consequences of MR Jars. As described, testing is the hardest part and there's just no "best" strategy. Every MR JAR library must decide what's their best fit. One way or another, you must execute your tests with all specified Java versions and Maven is not going to dictate that. For example: plexus-java is a multi-release jar, which relies heavily on the CI-server. When it runs on Java 7, it is building and testing only Java7 related code. For 9+ it builds the complete project. Trying to solve this with toolchains is possible, but requires a specific setup by the developer. None of the solutions could be solved by a simple surefire improvement. Unless I've overseen a option, I don't see any way how to solve this "by default"/"out-of-the-box" with surefire. I would expect that Maven needs to be improved first to understand this concept. Robert [1] https://github.com/codehaus-plexus/plexus-languages/tree/master/plexus-java/src/main On Thu, 04 Apr 2019 20:00:33 +0200, Russell Gold wrote: Yes, I know that’s how it works. The question is, how will developers use it? If MR jars are common, many developers will run into this problem, and it would be nice if Maven handled it by default. If it’s not common… those of with the issue will need to find workarounds. I have two open-source projects that create MR jars at present. On Apr 4, 2019, at 1:29 PM, Robert Scholte wrote: The specification you're talking about is the Multi Release Jar, and especially the last word is important: Jar. This only works with Jars and with a MANIFEST file containing Multi-Release: true Compiling and packaging has never been the issue, the tricky part is testing. If you want to test the jar, you must use the failsafe plugin (or bind surefire to the integration-test phase) All is described on the multirelease page of the maven-compiler-plugin[1] thanks, Robert [1] https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html On Thu, 04 Apr 2019 18:14:58 +0200, Russell Gold wrote: As of 3.8.0, the maven-compiler-plugin will place javaNNN source under META-INF/versions/NNN, which makes them ready for the jar plugin. But the surefire plugin ignores them! Is there a way to get the surefire plugin to run against them? They would need to be added on the class path ahead of the main output directory. I tried the setting, but that adds them later on the path, which is worthless. Or the tests could run against the built jar, but that violates the maven lifecycle order. My multirelease parent strategy doesn’t seem to work well for the multi-module case, as it can either build the MR jar normally, letting later modules test against it (but breaking the MR module’s unit tests), or copy the META-INF/versions classes into the output directory, letting the module’s unit test use them, but breaking jar building. I can see making the configuration much more complex, but it would be easier if there was a way to get the surefire plugin to recognize MR modules. Thanks, Russ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Surefire plugin with multi-release?
Yes, I know that’s how it works. The question is, how will developers use it? If MR jars are common, many developers will run into this problem, and it would be nice if Maven handled it by default. If it’s not common… those of with the issue will need to find workarounds. I have two open-source projects that create MR jars at present. > On Apr 4, 2019, at 1:29 PM, Robert Scholte wrote: > > The specification you're talking about is the Multi Release Jar, and > especially the last word is important: Jar. > > This only works with Jars and with a MANIFEST file containing Multi-Release: > true > > Compiling and packaging has never been the issue, the tricky part is testing. > If you want to test the jar, you must use the failsafe plugin (or bind > surefire to the integration-test phase) > > All is described on the multirelease page of the maven-compiler-plugin[1] > > thanks, > Robert > > [1] https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html > > On Thu, 04 Apr 2019 18:14:58 +0200, Russell Gold > wrote: > >> As of 3.8.0, the maven-compiler-plugin will place javaNNN source under >> META-INF/versions/NNN, which makes them ready for the jar plugin. But the >> surefire plugin ignores them! Is there a way to get the surefire plugin to >> run against them? They would need to be added on the class path ahead of the >> main output directory. I tried the setting, >> but that adds them later on the path, which is worthless. >> >> Or the tests could run against the built jar, but that violates the maven >> lifecycle order. >> >> My multirelease parent strategy doesn’t seem to work well for the >> multi-module case, as it can either build the MR jar normally, letting later >> modules test against it (but breaking the MR module’s unit tests), or copy >> the META-INF/versions classes into the output directory, letting the >> module’s unit test use them, but breaking jar building. >> >> I can see making the configuration much more complex, but it would be easier >> if there was a way to get the surefire plugin to recognize MR modules. >> >> Thanks, >> Russ >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Surefire plugin with multi-release?
The specification you're talking about is the Multi Release Jar, and especially the last word is important: Jar. This only works with Jars and with a MANIFEST file containing Multi-Release: true Compiling and packaging has never been the issue, the tricky part is testing. If you want to test the jar, you must use the failsafe plugin (or bind surefire to the integration-test phase) All is described on the multirelease page of the maven-compiler-plugin[1] thanks, Robert [1] https://maven.apache.org/plugins/maven-compiler-plugin/multirelease.html On Thu, 04 Apr 2019 18:14:58 +0200, Russell Gold wrote: As of 3.8.0, the maven-compiler-plugin will place javaNNN source under META-INF/versions/NNN, which makes them ready for the jar plugin. But the surefire plugin ignores them! Is there a way to get the surefire plugin to run against them? They would need to be added on the class path ahead of the main output directory. I tried the setting, but that adds them later on the path, which is worthless. Or the tests could run against the built jar, but that violates the maven lifecycle order. My multirelease parent strategy doesn’t seem to work well for the multi-module case, as it can either build the MR jar normally, letting later modules test against it (but breaking the MR module’s unit tests), or copy the META-INF/versions classes into the output directory, letting the module’s unit test use them, but breaking jar building. I can see making the configuration much more complex, but it would be easier if there was a way to get the surefire plugin to recognize MR modules. Thanks, Russ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Surefire plugin with multi-release?
As of 3.8.0, the maven-compiler-plugin will place javaNNN source under META-INF/versions/NNN, which makes them ready for the jar plugin. But the surefire plugin ignores them! Is there a way to get the surefire plugin to run against them? They would need to be added on the class path ahead of the main output directory. I tried the setting, but that adds them later on the path, which is worthless. Or the tests could run against the built jar, but that violates the maven lifecycle order. My multirelease parent strategy doesn’t seem to work well for the multi-module case, as it can either build the MR jar normally, letting later modules test against it (but breaking the MR module’s unit tests), or copy the META-INF/versions classes into the output directory, letting the module’s unit test use them, but breaking jar building. I can see making the configuration much more complex, but it would be easier if there was a way to get the surefire plugin to recognize MR modules. Thanks, Russ - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org