Dependency
Needs to be wrapped in a <dependencies> tag.
Ex:
<dependencies>
     <dependency>
         <id>bcel</id>
         <version>5.1</version>
     </dependency>
</dependencies>

Tim Chen
[EMAIL PROTECTED]


-----Original Message-----
From: Chad Woolley [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 12, 2003 6:50 PM
To: [EMAIL PROTECTED]
Subject: How do I get java:compile to automatically add dependencies to
classpath?


Hi,

I am starting a new simple java project.  I used the "Simple Java"
example from 
the examples plugin.  I only have two class files so far (test classes
not added 
yet).

The problem is that when I run java:compile, it does not add my
dependent jar to 
the classpath, even though I have it in the dependencies section.  I
also tried 
adding it to the override jars, but it still does not get added to the
classpath.

I have compared this to existing working projects, and I can't wee what
I am 
doing wrong.

Here's some info, let me know if I need to provide anything else.

Thanks,
Chad

--------------------------------------------

Dependency and build section from project.xml

     <dependency>
         <id>bcel</id>
         <version>5.1</version>
     </dependency>

     <build>
         <sourceDirectory>src\java</sourceDirectory>
         <unitTestSourceDirectory>src\test</unitTestSourceDirectory>
         <unitTest>
             <includes>
                 <include>**/*Test.java</include>
             </includes>
         </unitTest>
     </build>


----------------------------------------------

PROJECT.PROPERTIES:

#####################################################
# repository #####################################################
maven.build.dest=target\\main

#####################################################
# jar override #####################################################
maven.jar.override = on
maven.jarResources.basedir = ${pom.build.sourceDirectory} maven.jar.bcel
= ${basedir}/lib/bcel-5.1.jar

#####################################################
# java
#####################################################
maven.compile.debug = on
maven.compile.optimize = on
maven.compile.deprecation = on
maven.compile.target = 1.3
maven.compile.source = 1.3
maven.javadoc.source = 1.3

#####################################################
# test
#####################################################
maven.test.source = 1.3
maven.test.failure.ignore = true
maven.junit.fork = true



--------------------------------------------

VERBOSE CONSOLE OUTPUT:

java:compile:
     [echo] Compiling to target\main
     [javac] [DEBUG] fileset: Setup scanner in dir 
D:\projects\throwableutil\src\java with patternSet{ includes: []
excludes: 
[**/package.html] }
     [javac] [VERBOSE] org\throwableutil\ThrowableUtilsOrig.java added
as 
org/throwableutil/ThrowableUtilsOrig.class doesn't exist.
     [javac] [VERBOSE] org\throwableutil\ThrowableUtilsCreator.java
added as 
org/throwableutil/ThrowableUtilsCreator.class doesn't exist.
     [javac] Compiling 2 source files to
D:\projects\throwableutil\target\main
     [javac] [VERBOSE] Using modern compiler
     [javac] [VERBOSE] Compilation arguments:
'-deprecation'
'-d'
'D:\projects\throwableutil\target\main'
'-classpath'
'D:\projects\throwableutil\target\main;D:\maven\lib\forehead-1.0-beta-5.
jar'
'-sourcepath'
'D:\projects\throwableutil\src\java'
'-target'
'1.3'
'-g'
'-O'
'-source'
'1.3'

The ' characters around the executable and arguments are
not part of the command.

     [javac] [VERBOSE] Files to be compiled:
 
D:\projects\throwableutil\src\java\org\throwableutil\ThrowableUtilsOrig.
java
 
D:\projects\throwableutil\src\java\org\throwableutil\ThrowableUtilsCreat
or.java

D:\projects\throwableutil\src\java\org\throwableutil\ThrowableUtilsCreat
or.java:8: 
package org.apache.bcel does not exist
import org.apache.bcel.Constants;
                        ^








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


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

Reply via email to