Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant's optional tasks are not available on CentOS

When I run ant on CentOS to build java project I receive an error:

Could not create task or type of type: replaceregexp

ant -diagnostics shows that optional tasks are not available. How I can install optional tasks for ant?

Ant is installed from CentOS package.

like image 272
Junky Avatar asked Jan 20 '12 15:01

Junky


People also ask

How do you check ant is installed or not?

Check your installation by opening a command line and typing ant -version into the commend line. The system should find the command ant and show the version number of your installed Ant version.

How do I run Apache Ant?

Installing Apache Ant Ensure that the JAVA_HOME environment variable is set to the folder, where your JDK is installed. Unzip the zip file to a convenient location c:\folder by using Winzip, winRAR, 7-zip or similar tools. Create a new environment variable called ANT_HOME that points to the Ant installation folder.

How do I update my ant?

Copy the /about. html file from the old version to the new version. Open it and change the date to the current date (update the copyright as needed), Update the version of Ant mentioned and update the link to the what's new for the current release. Copy all of the files from the .


2 Answers

Works for me:

yum install ant-nodeps
like image 83
Junky Avatar answered Nov 09 '22 06:11

Junky


Run the following command, to download the jars associated with ANT's optional tasks:

ant -f $ANT_HOME/fetch.xml -Ddest=user -Dm2.url=http://repo1.maven.org/maven2 

For a full explanation, see the ANT Manual documentation.

like image 41
Mark O'Connor Avatar answered Nov 09 '22 05:11

Mark O'Connor