Hi I'm using Maven 2.0.1 and trying to use a non-standard Ant task (scriptdef), in my pom.xml. It's giving me this error: Embedded error: Could not create task or type of type: scriptdef.
The required jar for ant scriptdef task is included in my pom.xml as:
<dependency>
<groupId>bsf</groupId>
<artifactId>bsf</artifactId>
<version>2.3.0</version>
</dependency>
Looks like the Maven classpath is not being passed on to Ant...
I have checked the Maven documentation, but couldn't find the source of
error.
Any idea what's wrong here ?
My entire pom.xml is appended below.
Thanks in advance
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<packaging>maven-plugin</packaging>
<version>${version}</version>
<name>Maven Gateway Archetype</name>
<url/>
<dependencies>
<dependency>
<groupId>bsf</groupId>
<artifactId>bsf</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-apache-bsf</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks >
<scriptdef
name="lc" language="javascript">
<attribute name="property"/>
<attribute name="value"/>
.setNewProperty(attributes.get("property"),
.get("value").toLowerCase());
</scriptdef>
<basename
property="gw.name" file="${basedir}"/>
<lc
property="gw.name.lc" value="${gw.name}"/>
<echo>gw.name=${gw.name}</echo>
<echo>gw.name.lc=${gw.name.lc}</echo>
<echo>filtering...</echo>
<fileset
dir="${basedir}"/>
<filterset>
<filter
token="CLIENT_NAME" value="${gw.name}"/>
<filter
token="client_name" value="${gw.name.lc}"/>
<filter
token="basedir" value="${basedir}"/>
<filter
token="env" value="${env}"/>
</filterset>
<mapper
type="regexp" from="(.*)_GW(.*)\.(.*)" to="\1${gw.name}_GW\2.\3"/>
<echo>filetering complete.</echo>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>jar</id>
<phase>compile</phase>
<configuration>
<tasks>
<!-- this will
delegate to an ant build.xml, you could embed here your ant
tasks -->
<path
id="classpath">
<path
refid="maven.compile.classpath"/>
<path
refid="maven.plugin.classpath"/>
<path
refid="maven.dependency.classpath"/>
</path>
<ant
antfile="build/ant-build.xml" dir="${basedir}" inheritRefs="true">
<target
name="jar"/>
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
