Hi!
 
I'm trying to call a task using antrun plugin but for this task I would
like to use the pom's dependences in the classpath.
The error returned is: Caused by: taskdef class
com.sun.tools.xjc.XJCTask cannot be found   ( this is from jaxb-xjc.jar
in the dependency)
Who can i do it?
In fact I'm trying to use the jaxb 1.0 and I can't use the
maven-jaxb-plugin available in the repository cause it is just for
jaxb2.0, than I'm calling the compiler directly.
 
following the part of the pom:
 
  <dependency>
   <groupId>com.sun.tools.xjc</groupId>
   <artifactId>jaxb-xjc</artifactId>
   <version>1.0</version>
  </dependency>
 <build>
  <plugins>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.1</version>
    <executions>
     <execution>
      <id>generate-sources</id>
      <phase>generate-sources</phase>
      <configuration>
       <tasks>
        <property name="src.loc" value="./src" />
        <taskdef name="xjc"
           classname="com.sun.tools.xjc.XJCTask"
           classpathref="maven.dependency.classpath" />
 
        <target name="x">
           <xjc
                 schema="${src.loc}/main/resources/TestScript.xsd"
                 target="src/main/java/"
                 package="com.avaya.automation.testscripts" />
         </target>
<!--
        <ant antfile="${basedir}/build.xml"
         inheritRefs="true">
         <target name="x" />
        </ant>
 -->        
       </tasks>
      </configuration>
      <goals>
       <goal>run</goal>
      </goals>
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
 

Reply via email to