maven/maven-artifact-ant/sample.build.xml

42 lines
1.6 KiB
XML

<project name="foo" xmlns:artifact="antlib:org.apache.maven.artifact.ant" default="foo">
<target name="foo">
<!--
TODO...
- read .m2/settings.xml
- get dependencies from a POM
-->
<artifact:localRepository id="local.repository" location="${basedir}/target/local-repo" layout="default"/>
<artifact:remoteRepository id="deploy.repository" url="file://${basedir}/target/deployment-repo" layout="legacy"/>
<artifact:pom file="pom.xml" id="maven.project"/>
<artifact:dependencies pathId="dependency.classpath">
<dependency groupId="org.apache.maven.wagon" artifactId="wagon-provider-test" version="1.0-alpha-2"/>
<dependency groupId="org.codehaus.modello" artifactId="modello-core" version="1.0-alpha-2-SNAPSHOT"/>
<localRepository refid="local.repository"/>
</artifact:dependencies>
<artifact:install file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/>
<pom refid="maven.project"/>
</artifact:install>
<artifact:deploy file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/>
<remoteRepository refid="deploy.repository"/>
<pom refid="maven.project"/>
</artifact:deploy>
<artifact:deploy file="target/maven-artifact-ant-2.0-SNAPSHOT.jar">
<localRepository refid="local.repository"/>
<remoteRepository url="scp://localhost/tmp/deployment-repo">
<authentication username="brett" privateKey="${user.home}/.ssh/id_dsa"/>
</remoteRepository>
<pom refid="maven.project"/>
</artifact:deploy>
</target>
</project>