How to backport SShSession to Ant 1.7.1 - ant

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.

Related

Jenkins Cannot find executable for ANT

I'm using the automatic installation option for Ant but still jenkins complains that it cannot find the executable. Am I missing something? I have given the path to the ant version we use. It has successfully downloaded and unpacked it on the server but it still complains it can't find the executable.
Did you install Ant? Is it in Jenkin's PATH? If not, Jenkins cannot use the default version of Ant.
However, if you go into the Jenkins configuration page, you can install various versions of Ant. For example, you may want to install the latest version of Ant, and Ant 1.5 for that one project that cannot use any version of Ant beyond 1.5:
When you define your project, you can select the version of Ant you want to use. When you select that you want to Invoke Ant as a build step, you are given a drop down menu of what version of Ant you want to use. The first is the Default which is the Ant version found in your PATH. However, if you've gone into Jenkins configuration and downloaded other versions of Ant, you can use one of those instead.
I think is more easy to you install ant manually , or you need check the jenkins log file for detailed errors
Found what I missed. I had to add the name of the directory it unpacks the ant file to in the
"Subdirectory of extracted archive" field. Forgot to mention we are using a fairly old version of ant. (1.7.0).

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.

What version of ANT is being used by the antrun plugin

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

ant-metricstask.jar

Warning : since version 1.3.6 the anttask.jar as been renamed ant-metricstask.jar
As of version 1.3.2 the metrics plugin contains some ant tasks that can be used for headless operations as part of a nightly build for example. This section describes how to do this.
Where can i get it? I can not find it anywhere.
Are you looking for ant-metricstask.jar?
It's available in the eclipse plugin downloadable at
http://sourceforge.net/projects/metrics/files/
Point eclipse directly at the URL or download the updatesite_1.3.6.zip and you can get the jar inside.

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