On Sun, 2003-01-26 at 10:33, Renato Primavera wrote: > 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,
Look at the <dependencies/> section of any number of project.xml files. That's where you define your project dependencies that contribute to the classpath used to compile your project sources. If you don't want to use your own local repository put the following in your project.properties file: maven.jar.override = on maven.jar.myownjar = ${basedir}/lib/myownjar.jar For this to work you must have a dependency like: <dependencies> <dependency> <id>myownjar</id> <version>WILL BE IGNORED DUE TO THE OVERRIDE</version> </dependency> </dependencies> And maven will use the location you specified for myownjar and put it in the classpath. > 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 > >> > >> -- jvz. Jason van Zyl [EMAIL PROTECTED] http://tambora.zenplex.org In short, man creates for himself a new religion of a rational and technical order to justify his work and to be justified in it. -- Jacques Ellul, The Technological Society -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>