Download jars from nexus using ant build tool as done automatically in Maven -
i have build.xml(ant based) requires jar nexus copied in existing lib folder. i.e when builds should copy jar nexus version defined & copy in lib & compilation. happen in maven define artifact & version . if changed automatically download maven repo. how can in ant based builds?
experts pls advice.
i have taken example listed in thread 1 step further , created macrodef clean things bit re-use. see below downloading 2 artifacts nexus (one snapshot, 1 release).
<project> <target name="get-all"> <mkdir dir="lib" /> <nexus-get groupid="foo.bar" artifactid="some-artifact" version="1.0.28" repo="releases" extension="jar" dest="lib" /> <nexus-get groupid="foo.bar" artifactid="another-artifact" version="1.0.0-snapshot" repo="snapshots" extension="jar" dest="lib" /> </target> <macrodef name="nexus-get"> <attribute name="groupid"/> <attribute name="artifactid"/> <attribute name="version"/> <attribute name="repo"/> <attribute name="extension"/> <attribute name="dest"/> <sequential> <get src="http://my-nexus:9999/nexus/service/local/artifact/maven/redirect?r=@{repo}&g=@{groupid}&a=@{artifactid}&v=@{version}&e=@{extension}" dest="@{dest}/@{artifactid}.@{extension}" usetimestamp="true" /> </sequential> </macrodef>
Comments
Post a Comment