| Summary: | nested quotes in ${tycho.testArgLine} may lead to NPE | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Steffen Pingel <steffen.pingel> |
| Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | jan.sievers |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Steffen Pingel
Turns out this was not related to a Tycho update but caused by a change to the Hudson job configuration. Nested quotes seems to throw off Tycho: '-Dtest.vmargs="-ea -Dorg.eclipse.mylyn.wikitext.tests.disableOutput=true"' I changed that to "-Dtest.vmargs=-ea -Dorg.eclipse.mylyn.wikitext.tests.disableOutput=true" to fix it (the tests.vmargs property is passed to the surefire plug-in). I'll leave this bug open since it would be helpful if the error handling was improved. Full command that was failing: mvn clean verify -V -e "-DGERRIT_CHANGE_SUBJECT=ASSIGNED - bug 305169: Use different color for attachments marked with iplog flag https://bugs.eclipse.org/bugs/show_bug.cgi?id=305169" -DGERRIT_REFSPEC=refs/changes/15/15/1 -DGERRIT_BRANCH=master -DGERRIT_PATCHSET_NUMBER=1 -DGERRIT_CHANGE_URL=http://ci.mylyn.org/15 -DGERRIT_CHANGE_ID=Ibf22fe0d7a20189f83d37eb77f301deeb184f6be -DGERRIT_PATCHSET_REVISION=98359ac327a5e7b32b1e8427544ca5f310d8db68 -DGERRIT_CHANGE_NUMBER=15 -DGERRIT_PROJECT=org.eclipse.mylyn.tasks -Dmaven.test.failure.ignore=true '-Dtest.vmargs="-ea -Dorg.eclipse.mylyn.wikitext.tests.disableOutput=true"' -Dmaven.ext.class.path=/home/hudson/.hudson/maven/slavebundle/resources:/home/hudson/.hudson/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/home/hudson/.hudson/war/WEB-INF/lib/hudson-remoting-2.1.1.jar -Dhudson.eventspy.port=34587 -f pom.xml -fae I revisited this issue while fixing bug 427556. You can reproduce it by adding a surefire configuration e.g. in tycho-demo/itp01 <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-surefire-plugin</artifactId> <version>${tycho-version}</version> <configuration> <argLine>${test.vmargs}</argLine> </configuration> </plugin> and starting the build using mvn clean verify '-Dtest.vmargs="-ea -Dorg.eclipse.mylyn.wikitext.tests.disableOutput=true"' -X -e you will see in the debug build log: [DEBUG] (f) argLine = "-ea -Dorg.eclipse.mylyn.wikitext.tests.disableOutput=true Note the unbalanced quotes (probably eaten up by the shell process/java process that started mvn) The unbalanced quotes are the root cause, however the root cause is hidden by plexus utils which catch any Exception while parsing the line https://github.com/sonatype/plexus-utils/blob/master/src/main/java/org/codehaus/plexus/util/cli/Commandline.java#L784 You can also see in the build log "Error translating Commandline." This unspecific message masks the more specific exception throw new CommandLineException( "unbalanced quotes in " + toProcess ); being caught. See https://github.com/sonatype/plexus-utils/blob/master/src/main/java/org/codehaus/plexus/util/cli/CommandLineUtils.java#L377 This leaves String[] parts as null causing the follow up NPE. |