-
Notifications
You must be signed in to change notification settings - Fork 2
/
nexus-build.xml
94 lines (87 loc) · 4.9 KB
/
nexus-build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<project name="nexus-deploy" default="stage" basedir="."
xmlns:artifact="urn:maven-artifact-ant">
<import file="build.xml" as="apache"/>
<macrodef name="nexus-plugin" description="macro definition for publishing artifacts to nexus">
<attribute name="maven-jar"/>
<attribute name="pomname"/>
<attribute name="attachas" default="h2"/>
<sequential>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
<arg value="-Durl=${asfstagingrepo}"/>
<arg value="-DrepositoryId=${staging_repo_id}"/>
<arg value="-Dfile=@{maven-jar}"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DpomFile=@{pomname}"/>
<arg value="-Dclassifier=@{attachas}"/>
<arg value="-Dtype=jar"/>
<arg value="-Pgpg"/>
</artifact:mvn>
</sequential>
</macrodef>
<macrodef name="windowsnexus-plugin" description="macro definition for publishing artifacts to nexus">
<attribute name="maven-jar"/>
<attribute name="attachas" default=""/>
<attribute name="pomname" default=""/>
<sequential>
<artifact:mvn mavenHome="${env.MAVEN_HOME}" fork="true">
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file"/>
<arg value="-Durl=${staging_repo_url}"/>
<arg value="-DrepositoryId=${staging_repo_id}"/>
<arg value="-Dfile=@{maven-jar}"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DpomFile=@{pomname}"/>
<arg value="-Dclassifier=@{attachas}"/>
<arg value="-Dtype=jar"/>
</artifact:mvn>
</sequential>
</macrodef>
<macrodef name="windowsnexus-plugin-no-classifier" description="macro definition for publishing artifacts to nexus">
<attribute name="maven-jar"/>
<attribute name="pomname"/>
<sequential>
<artifact:mvn mavenHome="${env.MAVEN_HOME}" fork="true">
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file"/>
<arg value="-Durl=${asfstagingrepo}"/>
<arg value="-DrepositoryId=${staging_repo_id}"/>
<arg value="-Dfile=@{maven-jar}"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DpomFile=@{pomname}"/>
<arg value="-Dtype=jar"/>
</artifact:mvn>
</sequential>
</macrodef>
<target name="windows-stage" depends="apache.mvn-taskdef, apache.jar, apache.source-jar, apache.javadoc-jar, apache.smoketests-jar, apache.pigunit-jar, apache.set-version" description="deploy artifact to a nexus repository">
<windowsnexus-plugin maven-jar="${output.jarfile.core}" pomname="${pig.pom}"/>
<windowsnexus-plugin maven-jar="${output.jarfile.sources}" pomname="${pig.pom}" attachas="sources"/>
<windowsnexus-plugin maven-jar="${output.jarfile.javadoc}" pomname="${pig.pom}" attachas="javadoc"/>
<windowsnexus-plugin-no-classifier maven-jar="${pigunit.jarfile}" pomname="${pigunit.pom}"/>
<windowsnexus-plugin-no-classifier maven-jar="${smoke.tests.jarfile}" pomname="${pigsmoke.pom}"/>
<windowsnexus-plugin maven-jar="${output.jarfile.core-h2}" pomname="${pig.pom}" attachas="h2"/>
</target>
<macrodef name="nexus-plugin-no-classifier" description="macro definition for publishing artifacts to nexus">
<attribute name="maven-jar"/>
<attribute name="pomname"/>
<sequential>
<artifact:mvn>
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
<arg value="-Durl=${asfstagingrepo}"/>
<arg value="-DrepositoryId=${staging_repo_id}"/>
<arg value="-Dfile=@{maven-jar}"/>
<arg value="-Dpackaging=jar"/>
<arg value="-DpomFile=@{pomname}"/>
<arg value="-Dtype=jar"/>
<arg value="-Pgpg"/>
</artifact:mvn>
</sequential>
</macrodef>
<target name="stage" depends="apache.mvn-taskdef, apache.jar, apache.piggybank, apache.source-jar, apache.javadoc-jar, apache.smoketests-jar, apache.pigunit-jar, apache.set-version" description="deploy artifact to a nexus repository">
<nexus-plugin-no-classifier maven-jar="${piggybank.jarfile}" pomname="${piggybank.pom}"/>
<nexus-plugin maven-jar="${output.jarfile.core}" pomname="${pig.pom}"/>
<nexus-plugin maven-jar="${output.jarfile.sources}" pomname="${pig.pom}" attachas="sources"/>
<nexus-plugin maven-jar="${output.jarfile.javadoc}" pomname="${pig.pom}" attachas="javadoc"/>
<nexus-plugin-no-classifier maven-jar="${pigunit.jarfile}" pomname="${pigunit.pom}"/>
<nexus-plugin-no-classifier maven-jar="${smoke.tests.jarfile}" pomname="${pigsmoke.pom}"/>
<nexus-plugin maven-jar="${output.jarfile.core-h2}" pomname="${pig.pom}" attachas="h2"/>
</target>
</project>