Community
Participate
Working Groups
This bug is opened at the request of Mikael Barbero as the follow up of bug 472084. The following WTP build was created to run Maven and build WTP twice. https://hudson.eclipse.org/webtools/job/WTP-R3_7_x_Maintenance_test/24/ In the first run, Maven is started by the following command shell. /shared/common/apache-maven-latest/bin/mvn clean install -V -B -e -Dmaven.test.skip=true -Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -Dmaven.repo.local=/home/hudson/genie.webtools/.hudson/jobs/WTP-R3_7_x_Maintenance_test/workspace/.maven/repo -f pom.xml -P bree-libs -P eclipse-sign -X -ff --toolchains ./scripts/wtp-toolchain.xml The following messages were found in the build log and everything was built successfully. ... [DEBUG] Reading global toolchains from /shared/common/apache-maven-latest/conf/toolchains.xml [DEBUG] Reading user toolchains from /jobs/genie.webtools/WTP-R3_7_x_Maintenance_test/workspace/./scripts/wtp-toolchain.xml ... sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher clean install -V -B -e -Dmaven.test.skip=true -Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -Dmaven.repo.local=/home/hudson/genie.webtools/.hudson/jobs/WTP-R3_7_x_Maintenance_test/workspace/.maven/repo -f pom.xml -P bree-libs -P eclipse-sign -X -ff --toolchains ./scripts/wtp-toolchain.xml ... Building org.eclipse.wst.wsdl 1.2.400-SNAPSHOT [INFO] Compiling 145 source files to /jobs/genie.webtools/WTP-R3_7_x_Maintenance_test/workspace/webtools.webservices/bundles/org.eclipse.wst.wsdl/target/classes [DEBUG] Using javaHome: /shared/webtools/apps/IBMJava2-142-SR13FP10/jre ... [INFO] org.eclipse.wst.wsdl ............................... SUCCESS [ 3.717 s] ... In the second run, Maven 3 step was configured to run Maven 3.3.3 and the toolchain was not found during the build. /shared/common/apache-maven-3.3.3/bin/mvn clean install -V -B -e -Dmaven.test.skip=true -Dmaven.test.failure.ignore=true -Dmaven.test.error.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -Dmaven.ext.class.path=/home/hudson/genie.webtools/.hudson/maven/slavebundle/resources:/home/hudson/genie.webtools/.hudson/maven/slavebundle/lib/maven3-eventspy-3.1.jar:/home/hudson/genie.webtools/.hudson/war/webapp/WEB-INF/lib/hudson-remoting-3.0.3.jar -Dhudson.eventspy.port=58380 -Dmaven.repo.local=/home/hudson/genie.webtools/.hudson/jobs/WTP-R3_7_x_Maintenance_test/workspace/.maven/repo -f pom.xml -P bree-libs -P eclipse-sign -X -ff [INFO] Building org.eclipse.wst.wsdl 1.2.400-SNAPSHOT [DEBUG] Using javaHome: /opt/public/common/j2sdk1.4.2_19/jre
Moved to the Hudson project
I wonder whether someone can take a look at this problem since it has blocked our build for a while now. Thanks.
(In reply to Samuel Wu from comment #2) I'm not sure how this is an issue in Hudson. To me it looks like a build time configuration issue.
To elaborate a bit, the second maven run tries to use a toolchains which has been written as a maven document in the maven 3 configuration of Hudson. The content is exactly the same as the one in ./scripts/wtp-toolchain.xml. Unfortunately, it fails to do so and warn us with [WARN] o.h.m.e.EventSpyProcessor - Unhandled event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest@352e612e (org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest) This is just a warning but suspect that it prevents the Hudson maven integration to properly use the defined toolchain document because with this configuration the build fails with [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile) on project org.eclipse.wtp.releng.versionchecker: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'J2SE-1.5' found. See http://maven.apache.org/guides/mini/guide-using-toolchains.html -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.20.0:compile (default-compile) on project org.eclipse.wtp.releng.versionchecker: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'J2SE-1.5' found. See http://maven.apache.org/guides/mini/guide-using-toolchains.html Any idea?
Hello Winston, Any update?
(In reply to Samuel Wu from comment #5) From the log output from the maven3 builder, I don't see the property setting --toolchains ./scripts/wtp-toolchain.xml. I don't have access to see the job configuration. How do I see the job configuration?
(In reply to Winston Prakash from comment #6) OK, reproducible. I just created a dummy job with a dummy toolchain. It was not appearing in the command line.
Hi Winston, I'm glad that you produced the problem. I've added you to the access list of the build configuration.
Hi Winston, Any progress on this problem?
(In reply to Samuel Wu from comment #9) Actually I take that back. In fact it works as expected. My earlier testing was not good. This is how I tested now - Created a tool chain in maven 3 configuration and intentionally given the JDK path incorrect - Created a maven project with toolchain plugin configured to use the JDK configured in the Toolchain configured via maven 3 configuration - Created a Hudson job and added maven builder that includes the ToolChain Expected - If the toolchain document is loaded correctly, the toolchain maven plugin should complain about the invalid path I did a build and indeed the build failed that indicates the path was incorrect. Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project HudsonTest: Misconfigured toolchains. Non-existing JDK home configuration at /path/to/jdk/1.5 -> [Help 1]
(In reply to Winston Prakash from comment #11) Here is the build http://ci.hudson-ci.org/view/Tests/job/maven-toolchain-test/5/console
I ran the exact same job on one of our Hudson instance (https://hudson.eclipse.org/cbi/job/test-hudson-toolchains/lastBuild/console). I have a toolchain.xml defined in the ~/.m2 folder. No one provides the configuration required by your pom. However, I defined a toolchain document with the expected conf: <?xml version="1.0" encoding="UTF8"?> <toolchains> <!-- JDK toolchains --> <toolchain> <type>jdk</type> <provides> <version>1.5</version> <vendor>sun</vendor> </provides> <configuration> <jdkHome>/shared/common/jdk1.5.0-latest</jdkHome> </configuration> </toolchain> </toolchains> The toolchain document seems to be taken into account but I still got the warning: [WARN] o.h.m.e.EventSpyProcessor - Unhandled event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest@5ab7f23f (org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest) [WARN] o.h.m.e.EventSpyProcessor - Unhandled event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest@5ab7f23f (org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest) [INFO] o.h.m.e.h.MavenExecutionRequestHandler - Using tool-chains document ID: 44fff448-2c72-48b8-9b8f-6114a2946a6e During the maven build, it seems that it only take into account the ~/.m2/toolchains.xml.
(In reply to Mikael Barbero from comment #13) I'm not an expert in Maven internals, so I can't tell exactly what is happening. But it appears, maven is raising events on available resources and expects registered handlers to handle them accordingly at build time. Reading through the code, maven3 plugin has its own build time event handlers o.h.m.e.EventSpyProcessor is registered to handle only the events raised for its own resources, so I guess it handles the event raised for the Toolchain document created (eventually handled by o.h.m.e.h.MavenExecutionRequestHandler) However, since o.h.m.e.EventSpyProcessor does not know how to handle the events related to DefaultToolchains (~/.m2/toolchains), it simply warns that it was not handled and expected to be handled by other registered event handlers. Question would be whether the compiler plugin used the JDK defined in the custom Toolchain.
Would you please copy paste the content of the toolchain document you used on your hudson test instance? Thanks
(In reply to Mikael Barbero from comment #15) > Would you please copy paste the content of the toolchain document you used > on your hudson test instance? Thanks Here is the toolchain. <toolchains> <toolchain> <type>jdk</type> <provides> <id>J2SE-1.4</id> <vendor>ibm</vendor> </provides> <configuration> <jdkHome>/shared/webtools/apps/IBMJava2-142-SR13FP10/jre</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <id>J2SE-1.5</id> </provides> <configuration> <jdkHome>/shared/common/jdk-1.5.0-22.x86_64/jre</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <id>JavaSE-1.6</id> </provides> <configuration> <jdkHome>/shared/common/jdk1.6.0_45/jre</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <id>JavaSE-1.7</id> </provides> <configuration> <jdkHome>/shared/common/jdk1.7.0_25/jre</jdkHome> </configuration> </toolchain> </toolchains>
Thanks Samuel. I was actually asking to Winston :) sorry for the misunderstanding.
(In reply to Mikael Barbero from comment #17) > Thanks Samuel. I was actually asking to Winston :) sorry for the > misunderstanding. It's fine. At least Winston knows that his is the one wanted :)
Hi Winston, I wonder whether you can provide the toolchain file for Mikael. Thanks.
OOPs sorry. I simply used the sample one given here https://maven.apache.org/guides/mini/guide-using-toolchains.html
Created attachment 271917 [details] hudson config (bash + mvn3) and console output Did a little experiment for myself here, using wtp's parent pom build and a local toolchains.xml file. If I set invalid paths in the toolchains file, maven doesn't complain. So while the warning looks innocuous, it seems the toolchains file isn't being respected. That said, I looked for *.xml files in the WTP releng.aggregator project (including all the submodules) containing the word "toolchain" in any way ... and the only hit is line 440 of the wtp-parent pom: http://git.eclipse.org/c/webtools/webtools.releng.aggregator.git/tree/wtp-parent/pom.xml#n437 Of course the reason bad toolchain paths are being ignored here could be that there's no manifest or BREE set for this build.
I set up a job with Maven 3.5 and JDK 8 to actually test if the toolchain passed via commandline is respected. Here's the toolchain file (note the "BAD" suffix on paths): https://hudson.eclipse.org/webtools/view/webtools_R3_10/job/webtools-servertools_R3_10_toolchains/ws/.maven/repo/toolchains.xml It *IS* respected, since the build failed: [workspace] $ /shared/common/apache-maven-3.5.0/bin/mvn clean verify -V --global-toolchains /home/hudson/genie.webtools/.hudson/jobs/webtools-servertools_R3_10_toolchains/workspace/.maven/repo/toolchains.xml -t /home/hudson/genie.webtools/.hudson/jobs/webtools-servertools_R3_10_toolchains/workspace/.maven/repo/toolchains.xml -V -B -Dmaven.test.skip=false -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dsurefire.timeout=1800 -DskipWithIssues=false -Dmaven.ext.class.path=/home/hudson/genie.webtools/.hudson/maven/slavebundle/resources:/home/hudson/genie.webtools/.hudson/maven/slavebundle/lib/maven3-eventspy-3.1.jar:/home/hudson/genie.webtools/.hudson/war/webapp/WEB-INF/lib/hudson-remoting-3.0.3.jar -Dhudson.eventspy.port=41274 -Dmaven.repo.local=/home/hudson/genie.webtools/.hudson/jobs/webtools-servertools_R3_10_toolchains/workspace/.maven/repo -f pom.xml -P bree-libs -P eclipse-sign -ff ... [WARN] o.h.m.e.EventSpyProcessor - Unhandled event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest@781a9412 (org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest) [WARN] o.h.m.e.EventSpyProcessor - Unhandled event: org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest@781a9412 (org.apache.maven.toolchain.building.DefaultToolchainsBuildingRequest) ... [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project org.eclipse.wst.server.discovery: Non-existing JDK home configuration at /shared/webtools/apps/IBMJava2-142-SR13FP10/jreBAD -- https://hudson.eclipse.org/webtools/view/webtools_R3_10/job/webtools-servertools_R3_10_toolchains/1/console