ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Updates to the Maven Artifact Ant tasks
Date Wed, 08 Jun 2005 09:25:07 GMT
Brett Porter wrote:
> Hi,
> This is primarily for Steve and Nicola Ken as I'm not sure if/how
> closely they follow the Maven lists.
> Just wanted to let you know about the changes I dropped in for the
> dependencies and related tasks. Hopefully it is inline with the
> feedback you'd been providing.
> - added the ability to exclude specific transitive dependencies from
> being pulled in from a specific dependency

yes, cool.

> - ability to use a POM to specify dependencies and repositories, in
> addition to the ant types


> - full support for external configuration (proxies, authentication
> info, repository mirrors, local repository location). The search order
> is ~/.ant/settings.xml, then ~/.m2/settings.xml

Is settings.xml documented anywhere?

I just found last week where java1.5 puts its proxy settings, but a bit 
of it is "use the browser" which is inadequate. We really need a 
commons-proxy-setup library to do this for standalone apps in a 
consistent manner.

> - ability to export properties or references from the pom:
>   <artifact:setProperty property=""
> expression="project.parent.artifactId" pomRefId="maven.project" />
>   <artifact:setProperty ref="developers"
> expression="project.developers" pomRefId="maven.project" /> (not sure
> whether this is a useful thing or not - I just thought references made
> sense for object types)

I see. yes, it makes sense.

Here in ant-land, we've done two things to make the stuff work better


> This is only in the SVN version at the moment - if you'd like a
> development build published just let me know.
> Are there other features you see being needed, or is the focus now on
> the error handling, validation and testing? Here I only mean Ant
> specific things, as other features added to Maven like the dependency
> path reporting, version ranges and conflict resolution will work from
> the tasks as is, I think.
> The only thing I've got left on my list is to incoporate the Maven
> profiles support, but we need to play with that more on our end first.

1. build file tests; check handling of missing required items, etc, etc. 
ant-testutils is the jar for this.

2. I'd like to be able to create a mini-pom on the fly. I do this with 
echo today, and will move to echoproperties before long

    <target name="m2-make-pom" depends="m2-init" unless="project.haspom">
    <echo message="Creating Pom ${target.pom}" level="verbose"/>
    <echo file="${target.pom}"><![CDATA[<project>

(nb, if there is a pom, I copy it with property expansion from ant)

    <target name="m2-copy-pom" depends="m2-init" if="project.haspom">
      <copy file="${project.pom}" tofile="${target.pom}" >
       <!-- we expand ant properties here.  -->

This is a zero-dependency Pom... It'd make sense to actually import the 
dependency info declared elsewhere, without duplicating its entry.

3. Absence of a .pom file should not constitute a failure, if the jar is 
there. When hand patching stuff into a local cache, I have to hand 
generate stub poms just to stop it breaking

4., if it doesnt already, localRepository should take a File type and 
make an absolute URL of it:

  <localRepository location="../files" />

5. something to map from (artifact,groupid,version) to the path to a 
jar, to a pom, or the base dir. Here is my macro to get the dest 
directory, used when copying in local stuff.

     <macrodef name="m2-makepath">
       <attribute name="property"/>
       <attribute name="groupIDpath"/>
       <attribute name="artifactID" default="@{groupIDpath}"/>
       <attribute name="version"/>
         <property name="@{property}"
location="${m2.repository}/@{groupIDpath}/@{artifactID}/@{version}" />

this should do proper . to / conversion, which this macro omits.

I've attached one of my build files that does some of this stuff; its 
from a BSD-licensed project, not LGPL. I dont know how (L)GPL applies to 
build files, especially in a world of antlib, scriptdef and imports.

View raw message