What version of ANT is being used by the antrun plugin - ant

What version of ANT is being used by the antrun plugin and how do I control it to use a certain version of ANT distribution. Does this plugin actually pick up the ANT from the local distribution?

Based on the information in Maven Central it's using Ant 1.8.1.
http://search.maven.org/#artifactdetails|org.apache.maven.plugins|maven-antrun-plugin|1.6|maven-plugin
http://search.maven.org/#artifactdetails|org.apache.ant|ant-nodeps|1.8.1|jar

Related

Not able to see "Invoke ANT" option on Jenkins 2.85

I am using Jenkins version 2.85 and trying to invoke or add ANT plugin. However, I can't see "Invoke ANT" option under Global Tool Configuration.
I have configured ANT and verified the version as follows.
Apache Ant(TM) version 1.10.1 compiled on February 2 2017
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed
Kindly let me know how can I get "Invoke ANT" option.
Thanks,
Narasimha
You probably need to install Jenkins ANT plugin for that.
Install Ant Plugin by going to Manage Jenkins -> Manage Plugins -> Available Tab and search for Ant and install all the relevant ant plugin.
Configure ant plugin by going to Manage Jenkins -> Global Tool Configuration.
You'll see an option Ant, either install Ant if you don't have on the local system or if you have ant configured on your local system, directly provide the ANT_HOME.

Is there a way to let gradle use a specific ant version?

I am working with a third party framework that I am integrating gradle into. I am calling some old ant tasks. The problem is that the third party framework wants me to use:
either its own ant, that is packaged with it
a specific ant version, in this case 1.9.1
Unfortunately there is no way to set the ant version that is used by gradle. I can not figure out if its is possible to point gradle to any specific version within my environment.
So what do you think I could do?
Thanks in advance,
Denis.
If you need to use a different Ant version than the one that comes with Gradle, you'll have to call out to Ant via a JavaExec or Exec task, rather than using Gradle's built-in Ant support.

Can we use pom.xml into ANT

I know that, we can very well use ANT and Maven together to build the project.We can run ANT scripts through Maven's POM.xml. But my question is can we run pom.xml through ANT's build.xml ?
i.e. can we create maven build from build.xml
Yes, using maven ant tasks.
The page lists out multiple maven tasks which can be integrated into an ant build script, thus combining the features of both. To take an example, there is the mvn task, which as documented can do a full maven build from ant.
<artifact:mvn mavenHome="/path/to/maven-3.0.x">
<arg value="install"/>
</artifact:mvn>
Besides this, there are
Dependencies task
Install and Deploy tasks
Pom task
each described with examples.
Maven and ANT are very different build tools. In ANT you write all the logic yourself, whereas a standard build process is "baked in" with Maven.
The POM file contains no logic, instead it contains a series of declarations about your project.
If you understand well how Maven works, it is theoretically possible to take a POM and generate an ANT build that emulates the behaviour of the Maven build. I'm not aware of any solution which can easily convert in the other direction, mainly because ANT is missing Maven functionality, such as dependency management.
Instead of trying to convert an ANT build into Maven, I'd recommend that you keep your existing build logic and delegate the management of your classpath to the ivy or Maven ANT tasks. These tools also provide tasks to publish your build output to a Maven repository, enabling your project to share with other projects using Maven.
Finally, I'm an ivy advocate and wrote an ant2ivy script which can assist in upgrade process. It creates an initial set of configuration files for downloading your projects dependencies from the Maven central repository.

How to backport SShSession to Ant 1.7.1

I am stuck with Ant 1.7.1 for the moment for reasons I wont get into. I'd like to be able to use the SshSession Ant task to create SSH tunnels to some of my servers. But SshSession was introduced only in Ant 1.8.0.
I have no experience with custom Ant tasks. Would it be difficult to backport this task from 1.8.0 to 1.7.1 ? Where should I go to learn more on how to do that ?
Thanks for your help !
It looks like the source for the SShSession task is compatible with ant 1.7. Get the source for this task, and compile against ant 1.7 and the jsch jar. Then create a taskdef pointing to the class you've just created (jsch.jar will need to be in the ant lib dir or specified using the -lib option) and you should be good to go.

Ant 1.8.1 and StarTeam

I'm using Ant 1.8.1 and StarTeam 2008 R2.
I noticed in previous versions of Ant there were optional tasks which could be used to access a StarTeam repository.
These tasks seem to be absent in Ant 1.8.1? What happened to them? Do any tasks exist to do this, or do you have to create your own tasks using the StarTeam SDK 10.4 (which looks straightforward enough, but I wouldn't want to duplicate an existing effort)?
These tasks are present in the ant-starteam.jar.
I've noticed my binary distributions of ant 1.6 and 1.7 has this jar in the lib directory. But 1.8 does not.
This URL http://www.docjar.com/docs/api/org/apache/tools/ant/taskdefs/optional/starteam/package-index.html still defines these classes as part of the javadoc API for ant 1.8, so I guess it should work if you add the ant-starteam.jar into the ant/lib directory
I am using Ant 1.8.2 on OS X and was able to use the ant-starteam.jar for 1.7.1. Had to pass the location of the starteam library to ant like so
ant -lib "/Applications/starteam-en-10.4.7-java/lib/"
Saw this pointer on another forum. T

Resources