I've tried this in the maven.xml :

<preGoal name="java:compile">
<copy file="lib/myownjar.jar" todir="${maven.build.dest}"/>
</preGoal>

The JAR file is well copied into the target directory, but my problem is not solved.
In fact, I need include my JAR file to compile classes which are in my src/java/main directory.
The question is : how can I add a personal JAR in the classpath before maven compile my java files ?

Greetings,

RP


Jason van Zyl wrote:

On Sun, 2003-01-26 at 09:55, Renato Primavera wrote:

Hello All,


I'm trying to add a personal JAR, called "myownjar.jar" to my project.xml file, but when I try to compile this project with the "maven java:compile" command, the JAR seems not to be included.
It results some compilation errors...

Is something wrong in my <build> declaration ?

<build>
<sourceDirectory>src/java/main</sourceDirectory>
<unitTestSourceDirectory>src/java/test</unitTestSourceDirectory>
<jars>
<jar>lib/myownjar.jar</jar>
</jars>
</build>

<jars/> is a dead element.

You must use a preGoal to copy JARs into the final JAR:

<preGoal name="java:jar">
<copy file="myown.jar" todir="${maven.build.dest}"/>
</preGoal>


Thanks in advance,

RP


--
-----
PRIMAVERA Renato, Belgium
GSM : + 32 (0) 497 92 92 46
E-Mail : [EMAIL PROTECTED]
CV : http://membres.lycos.fr/primaverar/cv.pdf
-----
" Un Bug ? Utilisez Baygon ! "
-----
--




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to