Hi
No, and yes, explanations. No, you cannot add anything in the classpath of java:compile goal unless its a dependency declared in the project.xml and it does not support directories. But I have a solution that involved modifying (a single line) in the java plugin.


If you are not afraid of producing your own plugin (very easy believe me), here is the diff between version maven-java-plugin 1.5 (official) and 1.5.1 (my custom version of java plugin):

RCS file: /home/cvs/cvsroot/utilities/maven-plugins/maven-java-plugin/plugin.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -w -b -i -r1.1 -r1.2
100a101
> <ant:pathelement path="${maven.compile.cp.extra.dir}"/>



So basically, in the java:compile goal, you add this new element in the <classpath> element of the <javac>
<ant:javac>
....
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
there it is--> <ant:pathelement path="${maven.compile.cp.extra.dir}"/>
</ant:classpath>
...
</ant:javac>


Then set this property to your directory and you're done.

I've proposed this way of solving and also creating a new dependency type: directory! But no news whatsoever and by looking at the original java plugin code, you'll se that there is absolutely no other way to add an entry in the cp.

Hope it helps
Eric.

Litton, Tom - CEPM wrote:

Is there any way to add additional directories to the classpath maven uses for 
compiling?






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



Reply via email to