Hi,
I am using an <ejbjar> Ant task inside of a goal I defined in maven.xml. I get the following error when running the relevant goal :
=== BEGIN CONSOLE OUTPUT === __ __ | \/ |__ Jakarta _ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0-beta-9-SNAPSHOT
[DEBUG] Adding reference: maven.dependency.classpath -> /usr/local/maven/repository/jbossall-client/jars/jbossall-client-4.0.6.jar:/usr/local/maven/repository/servlet/jars/servlet-2.3.jar:/usr/local/maven/repository/struts/jars/struts-1.0.2.jar:
/usr/local/maven/repository/log4j/jars/log4j-1.2.7.jar:/usr/local/maven/repository/regexp/jars/regexp-1.2.jar:/usr/local/maven/repository/j2ee/jars/j2ee-1.3.1.jar:
/usr/local/maven/repository/jasper/jars/jasper-compiler-4.0.3.jar:/usr/local/maven/repository/xdoclet/jars/xdoclet-1.1.2.jar:
/usr/local/maven/repository/commons-logging/jars/commons-logging-1.0.2.jar:/usr/local/maven/repository/commons-collections/jars/commons-collections-2.0.jar:
/usr/local/maven/repository/commons-httpclient/jars/commons-httpclient-1.0.jar:/usr/local/maven/repository/httpunit/jars/httpunit-1.3.jar:
/usr/local/maven/repository/jtidy/jars/jtidy-4aug2000r7-dev.jar:/usr/local/maven/repository/junit/jars/junit-3.7.jar
[available] [VERBOSE] Found: src/java
[available] [VERBOSE] Found: src/test
[DEBUG] Adding reference: maven-classpath ->
[DEBUG] Adding reference: maven.compile.src.set ->
[DEBUG] Adding reference: maven.test.compile.src.set ->
epi:logger:
[ejbjar] Unable to load dependency analyzer: org.apache.tools.ant.util.depend.bcel.FullAnalyzer
=== END CONSOLE OUTPUT ===
The class file that is not found, is contained inside "ant-optional-1.5.1.jar", which lives in $MAVEN_HOME/lib.
I have cleared the "CLASSPATH" environment variable of all values, I have also tried adding "ant-optional-1.5.1.jar" as a dependency to project.xml. The error persists.
BCEL 5.0 is added as a dependency in project.xml.
Any ideas on what might be the matter ?
Good question. I ran into the same thing a while back, and after mucking around with it a little was unable to resolve the problem and went back to just using jar, atthough that's obviously not an optimal solution.
I think it is related to classloading, and the fact that ant is loaded implicitly by Maven. As opposed to other items that are listed as dependencies, ant may be in a different (higher) classloader than dependencies listed in the POM. I took a look at the ant code, and it does a simple Class.forName() to load the dependency analyzer. So even if the context classloader is set properly by Maven/Ant, it would not be used, and the BCEL classes would not be visible or loadable unless they were visible to the classloader for ant itself. This is why when you run ant standalone you typically have to add BCEL to the ant lib dir directly.
Jason, if you have a spare minute and know anything more, can you shed any more info on this?
Colin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
