Hi,

thank you for your quick answer.
My use case is a Jenkins job that triggers a gulp (javascript) build via
maven. This gulp build starts a closure-compiler (java) build in turn. The
JVM that performs the later compilations outputs to stderr the contents of
JAVA_TOOL_OPTIONS (
http://stackoverflow.com/questions/23265851/prevent-java-from-outputing-java-tool-options-to-stderr)
which makes the gulp builder assume the build failed (I also have opened a
ticket for this issue).
So I need to remove the JAVA_TOOL_OPTIONS environment property (its there
just because jenkins is configured so but its pointless for this build) but
I didn't see any setting in the maven-exec-plugin to just remove an
environment variable, did I miss something? Are you aware of another way to
execute my scripts in an environment without JAVA_TOOL_OPTIONS?

I agree I haven't read the whole issue, I assumed fixVersion = 1.3 implied
that it was fixed in the 1.3 version (IMO there are a lot of Jira
mechanisms to avoid this confusion). And the last comment 'Fixed in ....'
is kind of confusing so I got tricked ^^.

My workaround was to override my Jenkins configuration for this job and
delete the environment variable there so I don't have this issue any more
but I would prefer my build to pass even when someone run it in a different
environment than mine. Waiting for the next release fixing this is then
acceptable.

Regards,

Olivier


On Thu, Apr 24, 2014 at 5:48 PM, Karl Heinz Marbaise <khmarba...@gmx.de>wrote:

> Hi Oliver,
>
>
>
> > I want to call a script from my maven build so I use the maven-exec
>
>> plugin for this. The script I want to call calls in turn at some point
>> java and all environment variables are transmitted. I would like to
>> override JAVA_TOOL_OPTIONS and define an empty value for it so I used
>> the following configuration:
>>
>> <execution>
>> <id>gulp-build</id>
>> <phase>process-resources</phase>
>> <goals>
>> <goal>exec</goal>
>> </goals>
>> <configuration>
>> <executable>gulp</executable>
>>
>
> The following is an indicator that something is wrong...
>
>
>  <failWithNullKeyOrValueInEnvironment>false</
>> failWithNullKeyOrValueInEnvironment>
>>
>
>  <environmentVariables>
>>    <JAVA_TOOL_OPTIONS/>
>>
>
> Isn't there an other option do you really need to define an empty value?
> What about just removing the variable completely ? Doesn't that work?
>
>
>
>  </environmentVariables>
>> <workingDirectory>${basedir}/src/main/resources/webapp</workingDirectory>
>> <arguments>
>> <argument>maven</argument>
>> </arguments>
>> </configuration>
>> </execution>
>>
>> But then I end up with the same NPE that was reported in MEXEC-108
>> (http://jira.codehaus.org/browse/MEXEC-108) and marked as fixed in the
>> 1.3 version although I'm using this version:
>>
>
> If you had carefully read the JIRA Issue you would have dertermined that
> the issue is exactly describing your situation and finally given the hint
> that the pugin can't solve the problem only fail the build by default...
> If there will be a commons-exec:1.3 available in the future this can be
> used to turn off the failure if you would change the exec-maven-plugin
> configuration by using commons-exec:1.3 on the classpath of the plugin.
>
> But unfortunately it can't currently be changed cause the root cause of
> the problem is located in the commons-exec lib see the jira:
>
> https://issues.apache.org/jira/browse/EXEC-80
>
>
>  [DEBUG] Entry: key:JAVA_TOOL_OPTIONS value:null
>> [WARNING] The defined environment contains an entry with null value
>> (key:JAVA_TOOL_OPTIONS). This could cause failures.
>>
>
> Which is exactly the case here...
>
> Unfortunately this is currently not preventable cause the problem is
> located in the commons-exec part...
>
> Kind regards
> Karl-Heinz Marbaise
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Reply via email to