Hey there,
I haven't been able to figure this out hopefully somebody on the list has 
already solved that problem! 

Here we go:

I have a Maven project with git as the SCM and I need to pass a variable to the 
"Goal and options" in the build step to the -P flag (profiles), the value of 
that variable is computed using maven command line interface "mvn 
help:[...]grep[...]awk[...]pipes[...]" on the latest commit.
When building using mvn in a shell I have a one liner shell script,which I will 
call ONELINER to simplify, and so it's just a matter of running mvn clean 
install -P$(ONELINER). I have not been able to reproduce this using Jenkins...
I have tried the EnvInject plugin to run my one liner as pre build step but 
then I'm hitting this issue https://issues.jenkins-ci.org/browse/JENKINS-14193 .
It seems my main problem is that I need to run my one liner after an SCM poll 
but before the build step. So far my workaround is to create a properties file 
in my SCM with the pre computed value (the result of the one liner using a git 
hook) and then call that properties file using the EnvInj plugin "Build 
Environment Inject environment variables to the build process"; I would call 
the script from there unfortunately this is ran _before_ an SCM checkout when I 
need to run the oneliner on the latest commit.

I feel like I'm missing something rather obvious, am I?

Thanks for reading, any input greatly appreciated.

J.

Reply via email to