Hudson M2 Build Wrapping Lines and Failing Build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Hudson M2 Build Wrapping Lines and Failing Build

leojhartiv-2
Here's an odd one.  I have a M2 multi-module build set up.  I have the
following Maven-related settings:

Root pom: pom.xml
Goals and options: clean install
MAVEN_OPTS: -Denv=CI -Denv.props.path=/ess/application/shrci/
properties/environment.properties -Dlog4j.configuration=file:/ess/
application/shrci/log4j/log4j.xml -Dsurefire.useFile=false

The MAVEN_OPTS are all on one line with no spaces between - and D.

When the build runs, I am seeing the following:

12:42:49  [RELEASE_4.3.000.000] $ /cfesstbos1/java/jdk1.6.0_16/bin/
java -Denv=CI -Denv.props.path=/ess/application/shrci/properties/
environment.properties -Dlog4j.configuration=file:/ess/application/
shrci/log4j/log4j.xml -Dsurefire.useFile=false -cp /ess/hudson/plugins/
maven-plugin/WEB-INF/lib/maven-agent-1.391.jar:/ess/maven/boot/
classworlds-1.1.jar hudson.maven.agent.Main /ess/maven /ess/tomcat/
apache-tomcat-5.5.23/temp/5-hudson/WEB-INF/lib/remoting-1.391.jar /ess/
hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.391.jar
64325 /ess/hudson/plugins/maven-plugin/WEB-INF/lib/maven2.1-
interceptor-1.2.jar
12:42:52  <===[HUDSON REMOTING CAPACITY]===>channel started
12:42:57  Executing Maven:  -B -f /ess/hudson/jobs/PST3 -
RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/
RELEASE_4.3.000.000/pom.xml -Dmaven.repo.local=/ess/hudson/jobs/PST3 -
RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/.repository -
amd -pl com.fidelity.shares:redemptions,com.fidelity.shares:shares-
app,com.fidelity.shares:shares-dal,com.fidelity.shares:shares-domain
clean install
12:43:01  [INFO] Scanning for projects...

Notice the linebreak between  "-Denv=CI -" and :Denv.props.path...".
That seems to be causing a problem.

Lower when Hudson tries to execute tests, I get:

12:44:25  [INFO] Surefire report directory: /ess/hudson/jobs/PST3 -
RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/
RELEASE_4.3.000.000/shares-functions/shares-domain/target/surefire-
reports
12:44:26  Unrecognized option: -
12:44:26  Could not create the Java virtual machine.
12:44:26  [ERROR] There are test failures.
12:44:26
12:44:26  Please refer to /ess/hudson/jobs/PST3 - RELEASE_4.3.000.000
- Compile, Unit Test - M2/workspace/RELEASE_4.3.000.000/shares-
functions/shares-domain/target/surefire-reports for the individual
test results.

It never executes surefire and seems to be complaining about my -D
variables.

Is there any way I can get hudson not to wrap these variables?


FYI: I am running on a Solaris operating system.
Reply | Threaded
Open this post in threaded view
|

Re: Hudson M2 Build Wrapping Lines and Failing Build

leojhartiv-2
Ooops...posted too soon.  I think I found the real problem.

My job's name is "PST3 - RELEASE_4.3.000.000 - Compile, Unit Test -
M2".  When you select "use private repository", maven adds the
following to every mvn call:

-Dmaven.repo.local=/ess/hudson/jobs/PST3 - RELEASE_4.3.000.000 -
Compile, Unit Test - M2/workspace/.repository

Because the directory name is not encapsulated in quotes, I believe
Maven thinks it's a new command-line argument.  So either spaces
should not be allowed in job names or we need to encapsulate that
repository reference.

Personally, I think it'd be great if there was a name for a job AND a
display name.  The display name could be used on all dashboards, etc,
but the name would be used for stuff like this (folder creation) and
would be more restrictive.

Thoughts?  Shall I log an enhancement/defect?



On Dec 29, 1:05 pm, leojhartiv <[hidden email]> wrote:

> Here's an odd one.  I have a M2 multi-module build set up.  I have the
> following Maven-related settings:
>
> Root pom: pom.xml
> Goals and options: clean install
> MAVEN_OPTS: -Denv=CI -Denv.props.path=/ess/application/shrci/
> properties/environment.properties -Dlog4j.configuration=file:/ess/
> application/shrci/log4j/log4j.xml -Dsurefire.useFile=false
>
> The MAVEN_OPTS are all on one line with no spaces between - and D.
>
> When the build runs, I am seeing the following:
>
> 12:42:49  [RELEASE_4.3.000.000] $ /cfesstbos1/java/jdk1.6.0_16/bin/
> java -Denv=CI -Denv.props.path=/ess/application/shrci/properties/
> environment.properties -Dlog4j.configuration=file:/ess/application/
> shrci/log4j/log4j.xml -Dsurefire.useFile=false -cp /ess/hudson/plugins/
> maven-plugin/WEB-INF/lib/maven-agent-1.391.jar:/ess/maven/boot/
> classworlds-1.1.jar hudson.maven.agent.Main /ess/maven /ess/tomcat/
> apache-tomcat-5.5.23/temp/5-hudson/WEB-INF/lib/remoting-1.391.jar /ess/
> hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.391.jar
> 64325 /ess/hudson/plugins/maven-plugin/WEB-INF/lib/maven2.1-
> interceptor-1.2.jar
> 12:42:52  <===[HUDSON REMOTING CAPACITY]===>channel started
> 12:42:57  Executing Maven:  -B -f /ess/hudson/jobs/PST3 -
> RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/
> RELEASE_4.3.000.000/pom.xml -Dmaven.repo.local=/ess/hudson/jobs/PST3 -
> RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/.repository -
> amd -pl com.fidelity.shares:redemptions,com.fidelity.shares:shares-
> app,com.fidelity.shares:shares-dal,com.fidelity.shares:shares-domain
> clean install
> 12:43:01  [INFO] Scanning for projects...
>
> Notice the linebreak between  "-Denv=CI -" and :Denv.props.path...".
> That seems to be causing a problem.
>
> Lower when Hudson tries to execute tests, I get:
>
> 12:44:25  [INFO] Surefire report directory: /ess/hudson/jobs/PST3 -
> RELEASE_4.3.000.000 - Compile, Unit Test - M2/workspace/
> RELEASE_4.3.000.000/shares-functions/shares-domain/target/surefire-
> reports
> 12:44:26  Unrecognized option: -
> 12:44:26  Could not create the Java virtual machine.
> 12:44:26  [ERROR] There are test failures.
> 12:44:26
> 12:44:26  Please refer to /ess/hudson/jobs/PST3 - RELEASE_4.3.000.000
> - Compile, Unit Test - M2/workspace/RELEASE_4.3.000.000/shares-
> functions/shares-domain/target/surefire-reports for the individual
> test results.
>
> It never executes surefire and seems to be complaining about my -D
> variables.
>
> Is there any way I can get hudson not to wrap these variables?
>
> FYI: I am running on a Solaris operating system.
Reply | Threaded
Open this post in threaded view
|

Re: Hudson M2 Build Wrapping Lines and Failing Build

ljnelson
On Wed, Dec 29, 2010 at 1:20 PM, leojhartiv <[hidden email]> wrote:
So either spaces
should not be allowed in job names or we need to encapsulate that
repository reference.

I've encountered various problems with jobs that have spaces in their names.  For now, just don't use them, and you'll be a lot happier.

Best,
Laird