You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Denis Asparov (JIRA)" <ji...@codehaus.org> on 2007/05/21 12:29:58 UTC

[jira] Closed: (MANTRUN-71) Exception: Could not create task or type of type: target.

     [ http://jira.codehaus.org/browse/MANTRUN-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Denis Asparov closed MANTRUN-71.
--------------------------------

    Resolution: Cannot Reproduce

Sorry, i should not used 'target' task.

> Exception: Could not create task or type of type: target.
> ---------------------------------------------------------
>
>                 Key: MANTRUN-71
>                 URL: http://jira.codehaus.org/browse/MANTRUN-71
>             Project: Maven 2.x Antrun Plugin
>          Issue Type: Bug
>         Environment: Windows Home XP
>            Reporter: Denis Asparov
>
> pom.xml
> .....
> <plugin>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <executions>
>           <execution>
>             <phase>generate-sources</phase>
>             <goals>
>               <goal>run</goal>
>             </goals>
>             <configuration>
>               <tasks>
>                 <target if="myTarget.run" name="myTarget" depends="myTarget.check">
>                   <mkdir dir="${iplocks.dir}"></mkdir>
>                   <gunzip src="${tomcat.software.dir}/apache-tomcat-6.0.10.tar.gz"></gunzip>
>                   <untar dest="../target" src="${tomcat.software.dir}/apache-tomcat-6.0.10.tar"></untar>
>                   <move todir="../target/tomcat" failonerror="false">
>                     <fileset dir="../target/apache-tomcat-6.0.10"></fileset>
>                   </move>
>                   <delete dir="../target/apache-tomcat-6.0.10"></delete>
>                 </target>
>                 <target name="myTarget.check">
>                   <condition property="myTarget.run">
>                     <and>
>                       <available file="${tomcat.software.dir}/apache-tomcat-6.0.10.tar.gz" property="tomcat.exist"></available>
>                     </and>
>                   </condition>
>                 </target>
>            </tasks>
>             </configuration>
>           </execution>
>         </executions>
>    </plugin>
> .......
> mvn install give the following exception
> [INFO] [antrun:run {execution: default}]
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Could not create task or type of type: target.
> Ant could not find the task or a class this task relies upon.
> This is common and has a number of causes; the usual
> solutions are to read the manual pages then download and
> install needed JAR files, or fix the build file:
>  - You have misspelt 'target'.
>    Fix: check your spelling.
>  - The task needs an external JAR file to execute
>      and this is not found at the right place in the classpath.
>    Fix: check the documentation for dependencies.
>    Fix: declare the task.
>  - The task is an Ant optional task and the JAR file and/or libraries
>      implementing the functionality were not found at the time you
>      yourself built your installation of Ant from the Ant sources.
>    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
>      task and make sure it contains more than merely a META-INF/MANIFEST.MF.
>      If all it contains is the manifest, then rebuild Ant with the needed
>      libraries present in ${ant.home}/lib/optional/ , or alternatively,
>      download a pre-built release version from apache.org
>  - The build file was written for a later version of Ant
>    Fix: upgrade to at least the latest release version of Ant
>  - The task is not an Ant core or optional task
>      and needs to be declared using <taskdef>.
>  - You are attempting to use a task defined using
>     <presetdef> or <macrodef> but have spelt wrong or not
>    defined it at the point of use
> Remember that for JAR files to be visible to Ant tasks implemented
> in ANT_HOME/lib, the files must be in the same directory or on the
> classpath
> Please neither file bug reports on this problem, nor email the
> Ant mailing lists, until all of these causes have been explored,
> as this is not an Ant bug.
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> Could not create task or type of type: target.
> Ant could not find the task or a class this task relies upon.
> This is common and has a number of causes; the usual
> solutions are to read the manual pages then download and
> install needed JAR files, or fix the build file:
>  - You have misspelt 'target'.
>    Fix: check your spelling.
>  - The task needs an external JAR file to execute
>      and this is not found at the right place in the classpath.
>    Fix: check the documentation for dependencies.
>    Fix: declare the task.
>  - The task is an Ant optional task and the JAR file and/or libraries
>      implementing the functionality were not found at the time you
>      yourself built your installation of Ant from the Ant sources.
>    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
>      task and make sure it contains more than merely a META-INF/MANIFEST.MF.
>      If all it contains is the manifest, then rebuild Ant with the needed
>      libraries present in ${ant.home}/lib/optional/ , or alternatively,
>      download a pre-built release version from apache.org
>  - The build file was written for a later version of Ant
>    Fix: upgrade to at least the latest release version of Ant
>  - The task is not an Ant core or optional task
>      and needs to be declared using <taskdef>.
>  - You are attempting to use a task defined using
>     <presetdef> or <macrodef> but have spelt wrong or not
>    defined it at the point of use
> Remember that for JAR files to be visible to Ant tasks implemented
> in ANT_HOME/lib, the files must be in the same directory or on the
> classpath
> Please neither file bug reports on this problem, nor email the
> Ant mailing lists, until all of these causes have been explored,
> as this is not an Ant bug.
>         at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownEleme
> nt.java:493)
>         at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:39
> 1)
>         at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.jav
> a:158)
>         at org.apache.tools.ant.Task.perform(Task.java:363)
>         at org.apache.tools.ant.Target.execute(Target.java:341)
>         at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:87)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:443)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         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)
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 53 seconds
> [INFO] Finished at: Mon May 21 12:05:24 MSD 2007
> [INFO] Final Memory: 9M/19M
> [INFO] ------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira