You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Manos Batsis <ma...@geekologue.com> on 2007/04/04 16:27:19 UTC

antrun: Could not create task or type of type: scriptdef

Hello,

I'm trying to execute a scriptdef task through antrun as follows but get 
the error in the subjectline. I have included BSF as a plugin dependency 
and have tried to use inheritrefs/maven.plugin.classpath but no dice. 
Err, heeelp?

Many thanks,

Manos


pom.xml fragment:
--------------------------

<plugin>
   <artifactId>maven-antrun-plugin</artifactId>
   <executions>
     <execution>
       <id>antrun-test</id>
       <phase>test</phase>
       <configuration>
         <tasks>
           <ant target="test" antfile="src/build/build.xml" 
inheritrefs="true" inheritAll="true">
           </ant>
         </tasks>
       </configuration>
       <goals>
         <goal>run</goal>
       </goals>
     </execution>
   </executions>
   <dependencies>
     <dependency>
       <groupId>bsf</groupId>
       <artifactId>bsf</artifactId>
       <version>2.3.0</version>
     </dependency>
   </dependencies>
</plugin>


build.xml fragment:
--------------------------
<scriptdef name="jslint" language="javascript" 
classpathref="maven.plugin.classpath">

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


RE: antrun: Could not create task or type of type: scriptdef

Posted by Sean Hennessy <sh...@astutenetworks.com>.
For your reference..
  have some success using BUNDLED bsf and rhino to process Docbook
artifacts with ant..
  see samples below 

Regards,
Sean

<!-- BEG COMMENT ===========================
   pom.xml segment
   END COMMENT ======================= -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>pre-site</phase>
            <configuration>
              <tasks>
			  <typedef
resource="org/apache/maven/artifact/ant/antlib.xml">
                  <classpath refid="maven.dependency.classpath"/>
              </typedef>
			  <echo message="pom.xml:
maven-antrun-plugin"></echo>
                <tstamp>
                  <format locale="en" property="TODAY_UK"
pattern="d-MMM-yyyy"></format>
                </tstamp>
                <echo>pom.xml: timestamp ${TODAY_UK}</echo>
			 
			  <property refid="maven.dependency.classpath"
name="mvndepClasspath" />
 			  <ant inheritRefs="true" inheritAll="true"
antfile="${basedir}/src/4.bin/build.xml">
			  <property environment="env"/>
              <property value="true" name="project.debug"></property>
			  <property
file="${user.home}/build.properties"/>
			  <target name="cmn.outadate.tgt.nm" />
			  </ant>	
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
            <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact-ant</artifactId>
            <version>2.0.4</version>
            </dependency>
            <dependency>
            <groupId>ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.6.5</version>
            </dependency>
            <dependency>
            <groupId>jtidy</groupId>
            <artifactId>jtidy</artifactId>
            <version>4aug2000r7-dev</version>
            </dependency>
            <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>cpptasks</artifactId>
            <version>1.0b3</version>
            </dependency>
            <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b2</version>
            </dependency>
            <dependency>
            <groupId>ant</groupId>
            <artifactId>optional</artifactId>
            <version>1.5.4</version>
            </dependency>
            <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-antlr</artifactId>
            <version>1.6.5</version>
            </dependency>
            <dependency>
            <groupId>antlr</groupId>
            <artifactId>antlrall</artifactId>
            <version>2.7.4</version>
            </dependency>

            <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.6.5</version>
            </dependency>

			<dependency>
            <groupId>bsf</groupId>
            <artifactId>bsf</artifactId>
 
<systemPath>C:/usr/local/share/sdl/bsf-2_2/lib/bsf.jar</systemPath>
            <version>BUNDLED</version>
            <scope>system</scope>
            </dependency>
            <dependency>
        <groupId>js</groupId>
        <artifactId>js</artifactId>
 
<systemPath>C:/usr/local/share/sdl/rhino1_5R4_1/js.jar</systemPath>
        <version>BUNDLED</version>
        <scope>system</scope>
            </dependency>
        </dependencies>
      </plugin>
<!-- BEG COMMENT ===========================
   build.xml just one of many javascript targets used within ant.
   END COMMENT ======================= -->
<target name="dbook.xslt.tgt" >
   <echo message="******** dbook.xslt.tgt with
${proc.xslt.docbook.inp.file}"/>
  <echoproperties destfile="dbook.xslt.tgt.properties"
failonerror="false" />
  <script language="javascript"> <![CDATA[
        importPackage(Packages.org.apache.tools.ant.types); /* 01 */
        importPackage(Packages.org.apache.tools.ant.taskdefs);
/* 02 */
        importPackage(java.util);
        var tstrEchoMsg = new String(" START ==================
dbook.xslt.tgt.");
        prj = self.getProject();
        var echoTsk = prj.createTask("echo");
        
		var tStrBaseDir = new java.lang.String(
prj.getProperty("basedir"));
		var tStrFullPath = new java.lang.String(
prj.getProperty("proc.xslt.docbook.inp.file"));
		var tiBaseDirSiz = tStrBaseDir.length();
        var tiPosXMLExt = tStrFullPath.indexOf( ".xml");
        tStrRelHTMLPath = tStrFullPath.substring( tiBaseDirSiz+1,
tiPosXMLExt ) + ".html";
        echoTsk.setMessage(tstrEchoMsg);
        echoTsk.execute();
        
        echoTsk.setMessage(" tStrBaseDir =" + tStrBaseDir );
        echoTsk.execute();
        echoTsk.setMessage(" RelHTMLPath =" + tStrRelHTMLPath );
        echoTsk.execute();
           antcallTask=project.createTask("antcall");
           antcallTask.init();
           antcallTask.setTarget("cmn.exec.proc.dbook.tgt");
           antcallParam1=antcallTask.createParam();
           antcallParam1.setName("out.dir");
 
antcallParam1.setValue(prj.getProperty("SEE_SDF_SiteResources"));
           antcallParam2=antcallTask.createParam();
           antcallParam2.setName("main.infile");
           antcallParam2.setValue(
prj.getProperty("proc.xslt.docbook.inp.file"));
           antcallParam3=antcallTask.createParam();
           antcallParam3.setName( "main.outfile");
           antcallParam3.setValue( tStrRelHTMLPath );
           antcallTask.execute();
        echoTsk.setMessage(" END ================== dbook.xslt.tgt");
        echoTsk.execute();
    ]]> </script>
</target>

-----Original Message-----
From: Manos Batsis [mailto:manos_lists@geekologue.com] 
Sent: Wednesday, April 04, 2007 7:27 AM
To: Maven Users List
Subject: antrun: Could not create task or type of type: scriptdef



Hello,

I'm trying to execute a scriptdef task through antrun as follows but get

the error in the subjectline. I have included BSF as a plugin dependency

and have tried to use inheritrefs/maven.plugin.classpath but no dice. 
Err, heeelp?

Many thanks,

Manos


pom.xml fragment:
--------------------------

<plugin>
   <artifactId>maven-antrun-plugin</artifactId>
   <executions>
     <execution>
       <id>antrun-test</id>
       <phase>test</phase>
       <configuration>
         <tasks>
           <ant target="test" antfile="src/build/build.xml" 
inheritrefs="true" inheritAll="true">
           </ant>
         </tasks>
       </configuration>
       <goals>
         <goal>run</goal>
       </goals>
     </execution>
   </executions>
   <dependencies>
     <dependency>
       <groupId>bsf</groupId>
       <artifactId>bsf</artifactId>
       <version>2.3.0</version>
     </dependency>
   </dependencies>
</plugin>


build.xml fragment:
--------------------------
<scriptdef name="jslint" language="javascript" 
classpathref="maven.plugin.classpath">

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


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