maven-enforcer-plugin problems with test dependency in multi module project
Hi, I have a multi-module-project with one module that implements classes for testing (test-parent) and another module (test-child) that uses theses classes. There is a dependency in test scope from the test-child to the test-parent. (See article http://stackoverflow.com/questions/1725476/maven-test-dependency-in-multi-module-project and http://maven.apache.org/guides/mini/guide-attached-tests.html[http://maven.apache.org/guides/mini/guide-attached-tests.html]) The pom of the depending test-child contains the following code: dependencies dependency groupIdtest/groupId artifactIdtest-parent/artifactId version1.0-SNAPSHOT/version typetest-jar/type scopetest/scope /dependency /dependencies The test-parent module that contains the derived classes contains the following code: plugins plugin artifactIdmaven-jar-plugin/artifactId version2.2/version executions execution goals goaltest-jar/goal /goals phasetest-compile/phase /execution /executions /plugin /plugins In a parent pom the maven-enforcer-plugin is included and the RequireReleaseDeps rule is added to the list of rules. While running the Maven goal “compile” the project compilation of the test-child fails with the following message: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (default) on project test-child: Execution default of goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce failed: org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException: Could not resolve dependencies for project test:test-child:jar:1.0.0: Failure to find test:test-parent:jar:tests:1.0.0 It seems that Maven checks the dependencies of type and scope “test” in the compile phase. In the case the test-jar is build in the test-compile and is not present yet. This leads to the error. If I remove the RequireReleaseDeps from the rules it works fine. Here is the simplified config of the maven-enforcer-plugin: pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-enforcer-plugin/artifactId version${maven-enforcer-plugin.version}/version inheritedtrue/inherited executions execution goalsgoalenforce/goal/goals /execution /executions configuration !-- skip/ -- rules requireReleaseDeps onlyWhenReleasefalse/onlyWhenRelease /requireReleaseDeps requireMavenVersion version[3.0.4,]/version /requireMavenVersion /rules fail${maven-enforcer-plugin.fail}/fail /configuration /plugin /plugins /pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-enforcer-plugin/artifactId /plugin /plugins /build Is this behavior of the maven-enforcer-plug-in correct? If so, is there a way to work around it? Matthias - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Checking dependencyManagement content
Hi, As far as I know, there is no plugin out there that validates the content of the dependencyManagement section. There are more and more people using the so-called Bill of materials out there and having such a goal would be nice to make sure that the dependencies listed there are valid (still exists, proper type, etc) Anybody knows if such initiative exists? Thanks, S.
Maven process stuck on MacOS with Java8
Hi, Has anybody else noticed an issue with Java8 running Maven? I am using 1.8.0-ea-b124 and a maven command does not complete properly. It does not matter which plugin or phase is invoked, the process is stuck at the end and I have to ctrl-Z to go back to the shell. Switching back to Java 1.7 fixes the problem for me. Any idea? Thanks, S.
Re: Maven process stuck on MacOS with Java8
Can't say I've seen that with any of the 1.8 builds I've been trailing, either the official dev builds or the ones I'm compiling up myself... Have you tried looking at a thread dump and seeing where in Maven it's hanging? Mark On 31 Jan 2014, at 0:13, Stephane Nicoll wrote: Hi, Has anybody else noticed an issue with Java8 running Maven? I am using 1.8.0-ea-b124 and a maven command does not complete properly. It does not matter which plugin or phase is invoked, the process is stuck at the end and I have to ctrl-Z to go back to the shell. Switching back to Java 1.7 fixes the problem for me. Any idea? Thanks, S. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven process stuck on MacOS with Java8
Hello, Maven in general works for me, only thing I remember are problems with javadoc being checked more strictly now. Regards Mirko -- Sent from my mobile On Jan 30, 2014 12:14 PM, Stephane Nicoll stephane.nic...@gmail.com wrote: Hi, Has anybody else noticed an issue with Java8 running Maven? I am using 1.8.0-ea-b124 and a maven command does not complete properly. It does not matter which plugin or phase is invoked, the process is stuck at the end and I have to ctrl-Z to go back to the shell. Switching back to Java 1.7 fixes the problem for me. Any idea? Thanks, S.
Re: maven-enforcer-plugin problems with test dependency in multi module project
Hi, based on the error message you have a dependency on your test-jar project but you defined the dependency a little bit wrong: test:test-child:jar:1.0.0: Failure to find test:test-parent:jar:tests:1.0.0 This shows that you have defined a dependency in the test-parent but like this: dependencies dependency groupIdtest/groupId artifactIdtest-parent/artifactId version1.0-SNAPSHOT/version scopetest/scope /dependency /dependencies BUT you have to give the type in this case like this: dependencies dependency groupIdtest/groupId artifactIdtest-parent/artifactId version1.0-SNAPSHOT/version typetest-jar/type scopetest/scope /dependency /dependencies Best test is to comment out the maven-enforcer-rule and try to build your project just from the parent via mvn clean package I assume in your case without the above fix your project will not build. If it will you need to clean out your local repository first and retry it... Kind regards Karl Heinz Marbaise Hi, I have a multi-module-project with one module that implements classes for testing (test-parent) and another module (test-child) that uses theses classes. There is a dependency in test scope from the test-child to the test-parent. (See article http://stackoverflow.com/questions/1725476/maven-test-dependency-in-multi-module-project and http://maven.apache.org/guides/mini/guide-attached-tests.html[http://maven.apache.org/guides/mini/guide-attached-tests.html]) The pom of the depending test-child contains the following code: dependencies dependency groupIdtest/groupId artifactIdtest-parent/artifactId version1.0-SNAPSHOT/version typetest-jar/type scopetest/scope /dependency /dependencies The test-parent module that contains the derived classes contains the following code: plugins plugin artifactIdmaven-jar-plugin/artifactId version2.2/version executions execution goals goaltest-jar/goal /goals phasetest-compile/phase /execution /executions /plugin /plugins In a parent pom the maven-enforcer-plugin is included and the RequireReleaseDeps rule is added to the list of rules. While running the Maven goal “compile” the project compilation of the test-child fails with the following message: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (default) on project test-child: Execution default of goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce failed: org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException: Could not resolve dependencies for project test:test-child:jar:1.0.0: Failure to find test:test-parent:jar:tests:1.0.0 It seems that Maven checks the dependencies of type and scope “test” in the compile phase. In the case the test-jar is build in the test-compile and is not present yet. This leads to the error. If I remove the RequireReleaseDeps from the rules it works fine. Here is the simplified config of the maven-enforcer-plugin: pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-enforcer-plugin/artifactId version${maven-enforcer-plugin.version}/version inheritedtrue/inherited executions execution goalsgoalenforce/goal/goals /execution /executions configuration !-- skip/ -- rules requireReleaseDeps onlyWhenReleasefalse/onlyWhenRelease /requireReleaseDeps requireMavenVersion version[3.0.4,]/version /requireMavenVersion /rules fail${maven-enforcer-plugin.fail}/fail /configuration /plugin /plugins /pluginManagement plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-enforcer-plugin/artifactId /plugin /plugins /build - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org