I think you just need to declare the dependencies outside the <plugin></plugin> scope (particularly the one which holds the weblogic.ant.taskdefs.webservices.javaschema.JavaSchema class). Thus, your pom should look something like...

<dependencies>
       <dependency>
               <groupId>weblogic</groupId>
               <artifactId>webservices</artifactId>
               <version>SNAPSHOT</version>
       </dependency>
       <dependency>
               <groupId>weblogic</groupId>
               <artifactId>weblogic</artifactId>
               <version>SNAPSHOT</version>
       </dependency>
       <dependency>
               <groupId>weblogic</groupId>
               <artifactId>tools</artifactId>
               <version>SNAPSHOT</version>
       </dependency>
</dependencies>
<build>
        [...]
       <plugins>
               <plugin>
                       <artifactId>maven-antrun-plugin</artifactId>
                       <executions>
                               <execution>
                                        [...]
                               </execution>
                       </executions>
               </plugin>
       </plugins>
</build>


Let me know if this doesn't solve the problem.

-Lester



[EMAIL PROTECTED] wrote:

Hi

Thanks for your replly,

here is the error i'm getting
Embedded error: taskdef class weblogic.ant.taskdefs.webservices.javaschema.JavaSchema cannot be found [INFO] ----------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing ant tasks at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:544) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:469) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:448) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301
)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing ant tasks at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:77) at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:72) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:399) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
       ... 16 more
Caused by: taskdef class weblogic.ant.taskdefs.webservices.javaschema.JavaSchema cannot be found at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:483)
       at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:71)
       ... 19 more
Caused by: java.lang.ClassNotFoundException: weblogic.ant.taskdefs.webservices.javaschema.JavaSchema 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:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:219)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:457)
       ... 24 more
[INFO] ----------------------------------------------------------------------------

here is eg. from child (WebService Module), so when i do mvn package from here everything works fine, but i do that from parent it throws
above shown error in red


.............
       <build>
               <sourceDirectory>.</sourceDirectory>
               <resources>
                       <resource>
                               <targetPath>props</targetPath>
                               <directory>${basedir}</directory>
                               <includes>
                                       <include>*</include>
                               </includes>
                       </resource>
               </resources>
               <plugins>
                       <plugin>
                               <artifactId>maven-antrun-plugin</artifactId>
                               <executions>
                                       <execution>
                                               <id>WSRelated</id>
                                               <goals>
                                                       <goal>run</goal>
                                               </goals>
                                               <phase>process-classes</phase>
                                               <configuration>
                                                       <tasks>

<taskdef name="autotype" classname="weblogic.ant.taskdefs.webservices.javaschema.JavaSchema" />
                                                               <autotype 
wsdl="${basedir}/a.wsdl"
       destDir="${project.build.outputDirectory}"
       targetNameSpace="http://test.raghu.com";
                                                               
packageName="com.raghu.test">
<classpath> <fileset dir="/"> <include name="**/*.jar"/> </fileset> <fileset dir="target/classes"> <include name="**/*.class"/> </fileset> </classpath> </autotype>
                                                       </tasks>
                                               </configuration>
                                       </execution>
                               </executions>
                               <dependencies>
                                       <dependency>
                                               <groupId>weblogic</groupId>
                                               
<artifactId>webservices</artifactId>
                                               <version>SNAPSHOT</version>
                                       </dependency>
                                       <dependency>
                                               <groupId>weblogic</groupId>
                                               <artifactId>weblogic</artifactId>
                                               <version>SNAPSHOT</version>
                                       </dependency>
                                       <dependency>
                                               <groupId>weblogic</groupId>
                                               <artifactId>tools</artifactId>
                                               <version>SNAPSHOT</version>
                                       </dependency>
                               </dependencies>
                       </plugin>
               </plugins>
       </build>
........






i Raghurajan,


Would it be possible for you to provide snippets of your poms, particularly the maven-antrun-plugin declaration part, or the error log if any? I can't seem to replicate your problem.
Thanks.

[EMAIL PROTECTED] wrote:


Hi all

I have following structure

MyModule +
 |- EJB Module
 |         - - - pom.xml
 |- WebService Module
 |         - - - pom.xml
 +--- pom.xml

I do use some ant task def stuff in Webservice module


when i do "mvn clean package" from WebService Module it goes fine it does whatever ant taskdef suppose to do no problem. but when do same command from top level/project level like from MyModule directory its not finding the taskdef defined in Webservices Module. its very confusing. Any one can tell me whats wrong with thisPlease???

Reply via email to