Aether Ant Tasks in Fedora are now able to resolve artifacts from system repository using XMvn. This makes it easier to maintain packages built with Ant without the need to use build-classpath or build-jar-repository.
A big advantage of Aether Ant Tasks is that they support transitive dependencies. This means that if package is using Aether Ant Tasks to build then it doesn't need to be updated when a transitive dependency is added or removed.
Let me follow with self explanatory example:
$ cat build.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns:aether="antlib:org.eclipse.aether.ant" default="test">
<taskdef uri="antlib:org.eclipse.aether.ant" resource="org/eclipse/aether/ant/antlib.xml"/>
<aether:dependencies id="my-dep"> <dependency groupid="junit" artifactid="junit" version="SYSTEM"/> </aether:dependencies>
<target name="test"> <aether:resolve dependenciesref="my-dep"> <path refid="cp" classpath="compile"/> </aether:resolve>
<!-- Display what's the resulting classpath --> <property name="mycp" refid="cp"/> <echo message="${mycp}"/> </target> </project>
$ ant -Dxmvn.ant.enable=true Buildfile: /build.xml
test: [aether:resolve] Resolving artifacts [echo] /usr/share/java/junit.jar:/usr/share/java/hamcrest/core.jar
As we can see project dependency with all *transitive dependencies* was resolved correctly by Ant. I had to do two things: add <taskdef> defining Aether tasks (basically a single line of boilerplate) and set property "xmvn.ant.enable" (this property is needed only for now as this feature is still experimental).
Because XMvn requires Maven, "local mode" of aether-ant-tasks will work only if maven-local is installed. This can be changed in future, but would require additional work, which I'd rather avoid unless people find this feature useful and start using it.
Let me know if you have any comments.
-- Mikolaj Izdebski IRC: mizdebsk
On 09/11/2013 07:41 PM, Mikolaj Izdebski wrote:
Aether Ant Tasks in Fedora are now able to resolve artifacts from system repository using XMvn. This makes it easier to maintain packages built with Ant without the need to use build-classpath or build-jar-repository.
As a note: I added this feature on request from Pete MacKinnon in rhbz#1005971. It took me less than 2 hours to implement, test and describe it.
I already looked into adding "local mode" for Apache Ivy. It should be fairly easy to complete, but I didn't implement it simply because no one have asked for it. So if you would like to see better integration of other build tools with Fedora artifact repository then please request it. (I think remember someone discussing "local mode" for SBT, Simple Build Tool for Scala. If you need that, feel free to contact me.)
On 09/11/2013 01:53 PM, Mikolaj Izdebski wrote:
On 09/11/2013 07:41 PM, Mikolaj Izdebski wrote:
Aether Ant Tasks in Fedora are now able to resolve artifacts from system repository using XMvn. This makes it easier to maintain packages built with Ant without the need to use build-classpath or build-jar-repository.
As a note: I added this feature on request from Pete MacKinnon in rhbz#1005971. It took me less than 2 hours to implement, test and describe it.
I already looked into adding "local mode" for Apache Ivy. It should be fairly easy to complete, but I didn't implement it simply because no one have asked for it. So if you would like to see better integration of other build tools with Fedora artifact repository then please request it. (I think remember someone discussing "local mode" for SBT, Simple Build Tool for Scala. If you need that, feel free to contact me.)
FYI, I have added this request.
https://bugzilla.redhat.com/show_bug.cgi?id=1012612
java-devel@lists.fedoraproject.org