I am setting up a jenkins slave on a machine that is supposed to build a maven project containing some native C code. The machine itself however, is proving to be a problem. The machine is hosting a fairly old program, that uses a lot of environment variables, like JAVA_HOME, that maven needs to function properly. In order to run maven on the slave machine, i need to set these environment variables, before executing maven, or maven, and other dependencies, such as ssh, will not run. I cant just change the variables permanently, so i need a way to change en environment variable before executing the maven build.
I can execute the build manually by setting the environment variables before executing mvn, and the build works like a charm. But i need jenkins to trigger the build automatically.
As i see it i need to either: Configure jenkins to set environment variables before executing maven or Configure maven use specific values instead of certain environment variables (In such a way that jenkins can handle the execution)
Your help is much appreciated.
There are lots of options.
I suggest the first or second Option