[
https://issues.apache.org/jira/browse/MINVOKER-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16561612#comment-16561612
]
Simon Taddiken commented on MINVOKER-240:
-----------------------------------------
I have been able to fix this problem by placing a {{invoker.properties}} file
into the sub module. However I could not figure out from where this different
behavior originates
> Invoker execution fails in multi module project on jdk9
> -------------------------------------------------------
>
> Key: MINVOKER-240
> URL: https://issues.apache.org/jira/browse/MINVOKER-240
> Project: Maven Invoker Plugin
> Issue Type: Bug
> Affects Versions: 3.1.0
> Reporter: Simon Taddiken
> Priority: Minor
>
> I use the invoker plugin to test a maven enforcer rule I wrote
> ([https://github.com/skuzzle/restrict-imports-enforcer-rule)]
> I have an integration test which builds a simple multi module project and
> expects the build to fail. Thus, when the invoked plugin build fails, the
> main build should be successful. While this works on JDK 8, it does not on
> JDK 9. The build invoked by the invoker plugin fails, but then the main build
> fails as well. As the single module projects behave as expected I believe
> this is about multi module projects.
> Here is one build report showing the differences between jdk8 and 9:
> [https://travis-ci.org/skuzzle/restrict-imports-enforcer-rule/builds/408597114]
> Locally, I use the following versions:
> {noformat}
> Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d;
> 2017-10-18T09:58:13+02:00)
> Maven home: C:\Program Files\apache-maven\bin\..
> Java version: 9, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk-9
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family:
> "windows"{noformat}
> {noformat}
> java --version
> java 9
> Java(TM) SE Runtime Environment (build 9+181)
> Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
> {noformat}
> This is an extract of the build log of the invoked maven execution. You can
> see that the build clearly fails (even on jdk 9). Below you find the
> {{invoker.properties}} file which expects the build to fail.
> {noformat}
> [INFO] Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Build Order:
> [INFO]
> [INFO] Banned Import parent
> [INFO] Banned Import child
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Banned Import parent 1.0-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (default-cli) @ fail2 ---
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Banned Import child 1.0-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (default-cli) @
> fail2-module ---
> [WARNING] Rule 0: de.skuzzle.enforcer.restrictimports.RestrictImports failed
> with message:
> Encountered unexpected exception:
> Banned imports detected:
> in file: \de\skuzzle\enforcer\restrictimports\SampleClass.java
> java.util.ArrayList (Line: 3)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Banned Import parent ............................... SUCCESS [ 0.534
> s]
> [INFO] Banned Import child ................................ FAILURE [ 0.017
> s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.710 s
> [INFO] Finished at: 2018-07-26T18:57:20+02:00
> [INFO] Final Memory: 8M/30M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (default-cli)
> on project fail2-module: Some Enforcer rules have failed. Look above for
> specific messages explaining why the rule failed. -> [Help 1]
> {noformat}
> The {{invoker.properties}}:
> {noformat}
> invoker.goals=enforcer:enforce
> invoker.buildResult=failure
> {noformat}
> When building the main project with {{mvn verify}} the build fails, though
> the failure of the invoked execution was expected (Note the FAILED executions
> below, which both belong to multi module projects):
> {noformat}
> [INFO] --- maven-invoker-plugin:3.1.0:integration-test (default) @
> restrict-imports-enforcer-rule ---
> [INFO] Building: ban-static\pom.xml
> [INFO] ban-static\pom.xml ............................... SUCCESS
> (2.2 s)
> [INFO] Building: fail-in-test-code\pom.xml
> [INFO] fail-in-test-code\pom.xml ........................ SUCCESS
> (2.2 s)
> [INFO] Building: fail-with-parent\module\pom.xml
> [INFO] fail-with-parent\module\pom.xml .................. FAILED
> (2.6 s)
> [INFO] The build exited with code 1. See
> C:\Users\Simon\Documents\repositories\restrict-imports-enforcer-rule\target\it\fail-with-parent\module\build.log
> for details.
> [INFO] Building: fail-with-parent\pom.xml
> [INFO] fail-with-parent\pom.xml ......................... SUCCESS
> (2.2 s)
> [INFO] Building: fail1\pom.xml
> [INFO] fail1\pom.xml .................................... SUCCESS
> (2.2 s)
> [INFO] Building: fail2\pom.xml
> [INFO] fail2\pom.xml .................................... SUCCESS
> (2.3 s)
> [INFO] Building: ignore-fail-in-test-code\pom.xml
> [INFO] ignore-fail-in-test-code\pom.xml ................. SUCCESS
> (2.6 s)
> [INFO] Building: success-with-parent\module\pom.xml
> [INFO] success-with-parent\module\pom.xml ............... FAILED
> (2.8 s)
> [INFO] The build exited with code 1. See
> C:\Users\Simon\Documents\repositories\restrict-imports-enforcer-rule\target\it\success-with-parent\module\build.log
> for details.
> [INFO] Building: success-with-parent\pom.xml
> [INFO] success-with-parent\pom.xml ...................... SUCCESS
> (2.1 s)
> [INFO] Building: success1\pom.xml
> [INFO] success1\pom.xml ................................. SUCCESS
> (2.2 s)
> [INFO] Building: success2\pom.xml
> [INFO] success2\pom.xml ................................. SUCCESS
> (2.5 s)
> [INFO] Building: success3\pom.xml
> [INFO] success3\pom.xml ................................. SUCCESS
> (2.4 s)
> [INFO] Building: success4\pom.xml
> [INFO] success4\pom.xml ................................. SUCCESS
> (2.5 s)
> [INFO]
> [INFO] --- maven-dependency-plugin:2.9:analyze-only (analyze-dependencies) @
> restrict-imports-enforcer-rule ---
> [INFO] No dependency problems found
> [INFO]
> [INFO] --- pitest-maven:1.1.9:mutationCoverage (mutation-tests) @
> restrict-imports-enforcer-rule ---
> [INFO] Skipping project
> [INFO]
> [INFO] --- maven-invoker-plugin:3.1.0:verify (default) @
> restrict-imports-enforcer-rule ---
> [INFO] -------------------------------------------------
> [INFO] Build Summary:
> [INFO] Passed: 11, Failed: 2, Errors: 0, Skipped: 0
> [INFO] -------------------------------------------------
> [ERROR] The following builds failed:
> [ERROR] * fail-with-parent\module\pom.xml
> [ERROR] * success-with-parent\module\pom.xml
> [INFO] -------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> {noformat}
> You can find my configuration here:
> The main project's pom:
> [https://github.com/skuzzle/restrict-imports-enforcer-rule/blob/master/pom.xml]
> The integration test project being invoked:
> [https://github.com/skuzzle/restrict-imports-enforcer-rule/tree/master/src/it/fail-with-parent]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)