dev@glassfish.java.net

running regex in Ant file from maven: No supported regular expression matcher found

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Mon, 24 May 2010 23:43:44 +1000

I am working on an Ant task in tests/quicklook/build.xml that I hope
would eventually be run from maven as part of the build process.
This task relies on regular expressions (in <linecontainsregexp> and
<replaceregex>). It works fine when I run the target from Ant, but from
Maven I get the following error:

[INFO] An Ant BuildException has occured: The following error occurred
while executing this line:
/space/gfv3/quicklook/build.xml:125: The following error occurred while
executing this line:
/space/gfv3/quicklook/build.xml:631: No supported regular expression
matcher found

By googling for it I found that I am supposed to add a dependency for it
to its pom.xml:

                         <!-- following two regexp libraries are to support regex's in
check-logged-messages target -->
                    <dependency>
                        <groupId>ant-apache-regexp</groupId>
                        <artifactId>ant-apache-regexp</artifactId>
                        <version>1.6.5</version>
                        <scope>runtime</scope>
                    </dependency>
                    <dependency>
                        <groupId>jakarta-regexp</groupId>
                        <artifactId>jakarta-regexp</artifactId>
                        <version>1.4</version>
                    </dependency>

But with this the maven task tries to download these jars from the maven
depository where it can't find them.
How can I get this to work? Do I need to add these libraries to the
mazen repository or does someone already have a version of them
somewhere in there?

Thanks!
Dies