Werner Guttmann wrote:
Actually, using the Ant task definitely is an option to you.
Werner
That is the option I overlook now.
Is that an error in the anttaks pom or velocity is not automaticly
included? eg:
for deps:
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-anttasks</artifactId>
<version>1.2</version>
</dependency>
And tasks:
<tasks>
<property name="compile_classpath"
refid="maven.compile.classpath" />
<property name="runtime_classpath"
refid="maven.runtime.classpath" />
<property name="test_classpath"
refid="maven.test.classpath" />
<property name="plugin_classpath"
refid="maven.plugin.classpath" />
<echo message="compile classpath: ${compile_classpath}" />
<echo message="runtime classpath: ${runtime_classpath}" />
<echo message="test classpath: ${test_classpath}" />
<echo message="plugin classpath: ${plugin_classpath}" />
<taskdef name="castor-srcgen"
classname="org.castor.anttask.CastorCodeGenTask"
classpathref="maven.compile.classpath" />
<castor-srcgen
file="${basedir}/src/command/conf/fr/tqit/command/launcher/Launcher.xsd"
todir="${basedir}/src/command/generated"
bindingfile="${basedir}/src/command/conf/fr/tqit/command/launcher/bindings.xml"
properties="${basedir}/src/command/conf/castorbuilder.properties"
warnings="true" verbose="true"
generateImportedSchemas="false" />
</tasks>
I got a class not found arguing that velocity is not in classpath (which
is true, if I search in that classpath) with that lovely stacktrace:
java.lang.NoClassDefFoundError: org/apache/velocity/context/Context
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
org.exolab.castor.builder.printing.JClassPrinterFactory.init(JClassPrinterFactory.java:47)
at ...
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.ClassNotFoundException:
org.apache.velocity.context.Context
at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1166)
at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107)
at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 32 more
So I added :
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<packaging>pom</packaging>
<name>Apache Velocity</name>
<version>1.5</version>
Which worked.
(I put that for people in the same case than me)
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email