I must add tools.jar into my maven1 build config but I can't find any help.
Here is the solution I've found using the helpfull sugestion of geo:
I have modified the maven.xml build in order to add the tools.jar in the classpath. A pre-goal before java:compile does the stuff:
<preGoal name="java:compile">
<ant:path id="tools">
<ant:pathelement path="${tools.jar}"/>
</ant:path>
<maven:addPath id="maven.dependency.classpath" refid="tools"/>
</preGoal>
Below are result of my investiqgations and can be helpfull for someone trying to achieve the same unsing maven 2.x
How do I include tools.jar in my dependencies?
The following code includes tools.jar for JDKs on Windows, Linux and Solaris (it is already included in the runtime for Mac OS X and some free JDKs).
... <profiles> <profile> <id>default-tools.jar</id> <activation> <property> <name>java.vendor</name> <value>Sun Microsystems Inc.</value> </property> </activation> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.4.2</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </profile> </profiles> ...
Thanks to Geo, I have modified the maven.xml build in order to add the tools.jar in the classpath.
A pre-goal before java:compile does the stuff:
Should do the trick.This only works in an ant task.