You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Brett Porter <br...@gmail.com> on 2005/06/08 05:27:06 UTC
Updates to the Maven Artifact Ant tasks
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
- 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
- ability to export properties or references from the pom:
<artifact:setProperty property="parent.artifact.id"
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)
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.
Cheers,
Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Brett Porter wrote:
...
> This looks good, but looking at the examples you gave, I don't see any
> use of the PropertyHelper? I will have to spend some more time with it
> later on.
Shucks I forgot a link:
http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/optional/JXPath.java?rev=1.9.2.1&view=markup
Let me see if I can make something work myself, I'm starting to feel
ashamed of asking so much and not doing anything ;-)
>>Please do, I will use it right away.
>
> http://www.ibiblio.org/maven2/org/apache/maven/maven-artifact-ant/2.0-SNAPSHOT/maven-artifact-ant-2.0-20050608.072503-1-dep.jar
Installed.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Brett Porter <br...@gmail.com>.
On 6/8/05, Nicola Ken Barozzi <ni...@apache.org> wrote:
> I would use PropertyHelper instead:
>
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/PropertyHelper.java?view=markup
>
> Here is an example:
>
> http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/XMLDOM.java?view=markup
> http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/test.xml?rev=1.9&view=markup
>
> In this way, instead of
>
> <artifact:setProperty property="parent.artifact.id"
> expression="project.parent.artifactId"
> pomRefId="maven.project" />
>
> One could do something like:
>
> <property name="parent.artifact.id"
> value="${maven.project:project.parent.artifactId}">
This looks good, but looking at the examples you gave, I don't see any
use of the PropertyHelper? I will have to spend some more time with it
later on.
> Please do, I will use it right away.
http://www.ibiblio.org/maven2/org/apache/maven/maven-artifact-ant/2.0-SNAPSHOT/maven-artifact-ant-2.0-20050608.072503-1-dep.jar
Thanks,
Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Brett Porter wrote:
...
> 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
Definitely needed.
> - ability to use a POM to specify dependencies and repositories, in
> addition to the ant types
Good. I will use that, as transitive dependencies need that I upload a
POM along with the artifact. I would personally suggest that the ant
types are deprecated.
> - full support for external configuration (proxies, authentication
> info, repository mirrors, local repository location). The search order
> is ~/.ant/settings.xml, then ~/.m2/settings.xml
Good :-)
> - ability to export properties or references from the pom:
> <artifact:setProperty property="parent.artifact.id"
> 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 would use PropertyHelper instead:
http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/PropertyHelper.java?view=markup
Here is an example:
http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/src/java/org/apache/tools/ant/taskdefs/XMLDOM.java?view=markup
http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/test.xml?rev=1.9&view=markup
In this way, instead of
<artifact:setProperty property="parent.artifact.id"
expression="project.parent.artifactId"
pomRefId="maven.project" />
One could do something like:
<property name="parent.artifact.id"
value="${maven.project:project.parent.artifactId}">
> This is only in the SVN version at the moment - if you'd like a
> development build published just let me know.
Please do, I will use it right away.
> 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.
Looks good, bring it on! :-)
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Can you Please help me
Posted by Srinivas <cs...@mahindrabt.com>.
Dear Loughran,
I am new to ant Scripting. My requirement is like this. We are using
Weblogic.
I receive an .EAR file and before deployment my BUILD should do the
following.
a. My Script should locate the weblogic-ejb-jar.xml inside the .EAR and
<trans-time-out></trans-time-out>
Element should be modified per EJB basis.
What do you suggest?
Regards,
Srini.
-----Original Message-----
From: Steve Loughran [mailto:stevel@apache.org]
Sent: Thursday, June 09, 2005 2:31 PM
To: Ant Developers List
Subject: Re: Updates to the Maven Artifact Ant tasks
Brett Porter wrote:
> On 6/8/05, Steve Loughran <st...@apache.org> wrote:
>>Here in ant-land, we've done two things to make the stuff work better
>>
>>1.
>
>
> Are these the same points you added below?
no, I forgot to type some stuff
1. Resource collections are a new way of representing stuff; filesets
are inherently resource collections. I'm told this will make it easier
to manipulate filesets.
2. what was #2? I forget.
>
>
>>1. build file tests; check handling of missing required items, etc, etc.
>>ant-testutils is the jar for this.
>
>
> Ok, that will be worth a look. I'm pretty flat out for the next ocuple
> of weeks, then JavaOne, then holidays - so I'll revisit this next
> month :)
>
> Is this still going to give enough time to prepare for Ant 1.7?
Maybe. I might have a go at starting the test suite, its not too hard in
junit, and now AntUnit promises more simplicity.
>
>>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.
>
>
> I thought that was why dependencies had a fileset ID, so you didn't
> need to worry about constructing paths, or knowing where the local
> repository is if using external config?
its primarily for local deployment-by-copying. Now, maven itself has a
built in publish-to-a-repository goal doesnt it? That is what i really
need, I suspect. Push out an artifact to a location, generate a POM file
on demand, plus the checksums.
> Anyway, happy for this to go into JIRA. It can use the code already in
> Maven to set the property and it would be flexible across layouts.
>
> The proxy idea in a later email is also good, JIRA'd.
...just another example of how J2SE is laptop unfriendly. I think it
comes from sun's no-laptop-except-powerbooks-you-buy-yourself policy.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use
*********************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Steve Loughran <st...@apache.org>.
Brett Porter wrote:
> On 6/8/05, Steve Loughran <st...@apache.org> wrote:
>>Here in ant-land, we've done two things to make the stuff work better
>>
>>1.
>
>
> Are these the same points you added below?
no, I forgot to type some stuff
1. Resource collections are a new way of representing stuff; filesets
are inherently resource collections. I'm told this will make it easier
to manipulate filesets.
2. what was #2? I forget.
>
>
>>1. build file tests; check handling of missing required items, etc, etc.
>>ant-testutils is the jar for this.
>
>
> Ok, that will be worth a look. I'm pretty flat out for the next ocuple
> of weeks, then JavaOne, then holidays - so I'll revisit this next
> month :)
>
> Is this still going to give enough time to prepare for Ant 1.7?
Maybe. I might have a go at starting the test suite, its not too hard in
junit, and now AntUnit promises more simplicity.
>
>>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.
>
>
> I thought that was why dependencies had a fileset ID, so you didn't
> need to worry about constructing paths, or knowing where the local
> repository is if using external config?
its primarily for local deployment-by-copying. Now, maven itself has a
built in publish-to-a-repository goal doesnt it? That is what i really
need, I suspect. Push out an artifact to a location, generate a POM file
on demand, plus the checksums.
> Anyway, happy for this to go into JIRA. It can use the code already in
> Maven to set the property and it would be flexible across layouts.
>
> The proxy idea in a later email is also good, JIRA'd.
...just another example of how J2SE is laptop unfriendly. I think it
comes from sun's no-laptop-except-powerbooks-you-buy-yourself policy.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Brett Porter <br...@gmail.com>.
On 6/8/05, Steve Loughran <st...@apache.org> wrote:
> Is settings.xml documented anywhere?
http://maven.apache.org/maven2/maven-settings/settings.html
>
> 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.
Sounds like a reasonable idea.
> Here in ant-land, we've done two things to make the stuff work better
>
> 1.
Are these the same points you added below?
> 1. build file tests; check handling of missing required items, etc, etc.
> ant-testutils is the jar for this.
Ok, that will be worth a look. I'm pretty flat out for the next ocuple
of weeks, then JavaOne, then holidays - so I'll revisit this next
month :)
Is this still going to give enough time to prepare for Ant 1.7?
> 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
I thought about this, actually. So declaring it inside the <pom> tag
instead of loading from a file? Should be pretty straightforward as
long as the setters are in place.
> 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
Right... JIRA'd.
> 4., if it doesnt already, localRepository should take a File type and
> make an absolute URL of it:
>
> <localRepository location="../files" />
Yep, that's what it does.
> 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.
I thought that was why dependencies had a fileset ID, so you didn't
need to worry about constructing paths, or knowing where the local
repository is if using external config?
Anyway, happy for this to go into JIRA. It can use the code already in
Maven to set the property and it would be flexible across layouts.
The proxy idea in a later email is also good, JIRA'd.
- Brett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: Updates to the Maven Artifact Ant tasks
Posted by Steve Loughran <st...@apache.org>.
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
ok
> - 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="parent.artifact.id"
> 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
1.
>
> 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>
<modelVersion>4.0.0</modelVersion>
<groupId>${m2.groupID}</groupId>
<artifactId>${artifact.name}</artifactId>
<packaging>jar</packaging>
<version>${Version}</version>
</project>
]]></echo>
(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. -->
<filterchain>
<expandproperties/>
</filterchain>
</copy>
</target>
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"/>
<sequential>
<property name="@{property}"
location="${m2.repository}/@{groupIDpath}/@{artifactID}/@{version}" />
</sequential>
</macrodef>
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.
Re: Updates to the Maven Artifact Ant tasks
Posted by Steve Loughran <st...@apache.org>.
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.
> - full support for external configuration (proxies, authentication
> info, repository mirrors, local repository location). The search order
> is ~/.ant/settings.xml, then ~/.m2/settings.xml
ok. one more feature, and its for maven in general, rather than just ant
If the user lists a proxy server, and an nslookup of that hostname
fails, try to connect without using the proxy. This is a simple way to
adapt to a roaming where there is a proxy, but only sometimes.
\cite{the secret life of notebooks}
http://www.hpl.hp.com/techreports/2000/HPL-2000-21.html
http://www.iseran.com/Steve/notebook_slides.pdf
my laptop actually runs something that changes IE's proxy settings based
on inferred location; ip address, hostname and WLAN name being the
primary cues. But changing IE doesnt do anything for the rest of the
system. I dont want to have to switch settings.xml files all the time
just to get building work as I roam, not when the tools can make a
reasonable guess (or, with Java1.5's isReachable()), a very informed
decision.
-steve
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org