maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billybacon <billy.ba...@gmail.com>
Subject jvm arguments not making it to application and unit tests
Date Thu, 26 Apr 2012 15:52:41 GMT
I previously posted this question on the jenkins forum group and was asked to
move the topic to the maven forums because this is considered a maven issue,
not a jenkins issue.

Here is response and original post:

Surefire does it's best to provide the forked test cases with a clean
environment. Thus it will not pass through system properties unless
explicitly told to.

Your solution is to configure the Pom to tell Surefire to pass those
properties through. Most likely this will be one of the very few cases where
you may want to use a profile in your Pom.

This is really a maven issue and not a Jenkins issue, so I would rather if
we take it up on users@m.a.o I will be happy to help there


----- Original Post -------
We are running Jenkins ver. 1.447.1 and was hoping the latest upgrade
would resolve this but the outcome is the same. The jvm arguments we
are configuring in the Goals and options field are not making it into
the application and unit tests when the Jenkins job executes. We are
seeing the following in the console output:

Executing Maven:  -B -f /opt/hudson/home/jobs/alex-vendor/workspace/
pom.xml clean package -DAWS_ACCESS_KEY_ID=xxxxxxxxxxxx -
DAWS_SECRET_KEY=xxxxxxxxxxxx -
DJDBC_CONNECTION_STRING=jdbc:postgresql://xxxxxxxxxxxx:5432/test?
user=xxxx&yyyy=aws -DPARAM1=5 -DPARAM2=localhost:8080 -DPARAM3=false

This output looks great and I anticipated everything working but for
whatever reason, these jvm args seem to be filtered out and never make
it to our unit tests. We've even tried encapsulating each jvm arg in
double quotes, but the results are the same (unit test failures).

The only way we've been successful in passing these arguments is
through the maven-surefire-plugin (via argLine element) which isn't
adequate for us; we need to change credentials on a per job basis.

Lastly, we even tried the EnvInject Plugin but unfortunately, that
gave us no success as well.

Does anyone see what we have misconfigured? Our application never sees
the JDBC_CONNECTION_STRING jvm arg and throws an exception b/c it's
missing when the job executes.

Thanks for any help.

- Billy -

--
View this message in context: http://maven.40175.n5.nabble.com/jvm-arguments-not-making-it-to-application-and-unit-tests-tp5667993p5667993.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message