Re: Updates to the Maven Artifact Ant tasks
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.9view=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 [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Updates to the Maven Artifact Ant tasks
On 6/8/05, Nicola Ken Barozzi [EMAIL PROTECTED] 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.9view=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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Updates to the Maven Artifact Ant tasks
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 modelVersion4.0.0/modelVersion groupId${m2.groupID}/groupId artifactId${artifact.name}/artifactId packagingjar/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. ?xml version=1.0? project name=cddlm-specification default=default xmlns:artifact=antlib:org.apache.maven.artifact.ant description Build file for the CDDLM deliverables -deployment JAR file containing schemas Needs Artifact antlib from http://maven.apache.org /description !-- override point -- property file=build.properties/ !-- we are now preparing for ggf14 -- property name=project.version value=ggf14-alpha / property name=Version value=${project.version} / target name=init !-- declare directories -- property name=xml.dir location=xml/ property name=cddlm.dir location=${xml.dir}/api/ property name=cdl.dir location=${xml.dir}/cdl/ property name=constants.xml.dir location=${cddlm.dir}/ property name=wsrf.dir
Re: Updates to the Maven Artifact Ant tasks
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.1view=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 [EMAIL PROTECTED] - verba volant, scripta manent - (discussions get forgotten, just code remains) - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Updates to the Maven Artifact Ant tasks
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Updates to the Maven Artifact Ant tasks
On 6/8/05, Steve Loughran [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]