Now I feel silly. I found the answer in the docs, here:
http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html
Here's my exmaple POM after applying the required changes to make it
work (note the dependencies added to the plugin):
<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>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>baz</id>
<phase>process-classes</phase>
<configuration>
<tasks>
<property name="ant.regexp.regexpimpl"
value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"/>
<replaceregexp file="build.properties"
match="OldProperty=(.*)"
replace="NewProperty=\1"
byline="true"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.6.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
-Max
Max Cooper wrote:
I need to be able to use ReplaceRegExp task in an antrun script.
However, using ReplaceRegExp requires at least one additional jar in the
Ant classpath (see: http://ant.apache.org/manual/CoreTypes/regexp.html).
I don't know how to get the additional jar into the Ant classpath.
In my case, I want to use the JDK1.4 regexp package, which requires
ant-nodeps.jar. I have set the value of ant.regexp.regexpimpl to
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp to make my choice
clear to Ant.
To make my question absolutely clear, what do I need to change in this
pom.xml file to make this build succeed?
<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>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>baz</id>
<phase>process-classes</phase>
<configuration>
<tasks>
<property name="ant.regexp.regexpimpl"
value="org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"/>
<replaceregexp file="build.properties"
match="OldProperty=(.*)"
replace="NewProperty=\1"
byline="true"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thanks,
-Max
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]