I want to build a maven integrated project with a given java home property. At exactly i want to write a code in java that sets the java home property for an InvocationRequest object. The main goal is to build a project with the runtime given(by an algorithm) java home. So i would call getInvoker().execute(request);
to execute maven goals where request is an InvocationRequest object.
I tried to set the request java.home property with
properties.setProperty(Goals.JAVA_HOME, javaHomePath);
and call the method executeGoals(pom, new String[] { Goals.INSTALL, Goals.CLEAN }, properties);
.
This executeGoals(...) method contains getInvoker().execute(request) call and the request object definition too.
Output is: Missing: 1) com.sun:tools:jar:1.5.0
#Solved
EDIT: solved the output problem, but a new one appeared:
class file has wrong version 50.0, should be 49.0
. Maybe i changed the jre home, so i think i'm compiling with a newer version of java than i'm running with.
Reminder: i want to build with a specified java home property = i want to change the compiler java home(or version) to the specified one. (In eclipse)
I would appreciate any help.