You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Melo, Alexandre (Alexandre)" <am...@avaya.com> on 2006/12/14 18:39:00 UTC

pom dependences on the antrun plugin

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>
 

Re: pom dependences on the antrun plugin

Posted by Dave Syer <da...@hotmail.com>.
Have you tried putting the taskdef inside the target that needs it?  E.g.

        <target name="x">
          <taskdef name="xjc"
             classname="com.sun.tools.xjc.XJCTask"
             classpathref="maven.dependency.classpath" />
 
           <xjc
                 schema="${src.loc}/main/resources/TestScript.xsd"
                 target="src/main/java/"
                 package="com.avaya.automation.testscripts" />
         </target>


-- 
View this message in context: http://www.nabble.com/pom-dependences-on-the-antrun-plugin-tf2822307s177.html#a7878788
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: pom dependences on the antrun plugin

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/14/06, Melo, Alexandre (Alexandre) <am...@avaya.com> wrote:

> 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)

I can't find jaxb-xjc version 1.0, but trying it with
openejb:jaxb-xjc:2.0EA3, I can get a different error by putting the
<dependency> inside the <plugin> element.  So,
<plugin><dependencies><dependency> for the antrun plugin.

With that, I get:
   Embedded error: Could not create task or type of type: target.
   Ant could not find the task or a class this task relies upon.
instead of
  Embedded error: taskdef class com.sun.tools.xjc.XJCTask cannot be found

I'm not sure if that's progress. :)

I also ran across this jaxb plugin while searching for the jar:
   https://jaxb.dev.java.net/jaxb-maven2-plugin/

HTH,
-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: pom dependences on the antrun plugin

Posted by Dave Syer <da...@hotmail.com>.


Melo, Alexandre (Alexandre) wrote:
> 
> No, I think the order is ok, if I inverte the order, look what is
> happen..
> 

Hmm.  That's funny because I use this pattern quite a lot and I have had
issues, but they always went away when the taskdef was nested (this is
because otherwise Ant will try to create the target before the task is
defined, if they are at the same level).  Is your task definitely on the
classpath with the reference you used?

-- 
View this message in context: http://www.nabble.com/pom-dependences-on-the-antrun-plugin-tf2822307s177.html#a7928402
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org