-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnexus-build.xml
108 lines (102 loc) · 4.78 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<project name="nexus-deploy" default="windows-stage" basedir="."
xmlns:artifact="urn:maven-artifact-ant">
<import file="build.xml" as="apache"/>
<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=${staging_repo_url}"/>
<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-prep, apache.jar-all, apache.srcjars"
description="deploy artifact to a nexus repository">
<windowsnexus-plugin-no-classifier maven-jar="${build.dir}/${dest.jar}"
pomname="${sqoop.pom}"/>
<windowsnexus-plugin
maven-jar="${build.srcjar.dir}/${artifact.name}-sources.jar"
pomname="${sqoop.pom}" attachas="sources"/>
<windowsnexus-plugin-no-classifier
maven-jar="${build.dir}/${test.jar}" pomname="${sqooptest.pom}"/>
<windowsnexus-plugin
maven-jar="${build.srcjar.dir}/${name}-test-${version}-sources.jar"
pomname="${sqooptest.pom}" attachas="sources"/>
</target>
<macrodef name="nexus-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"/>
<arg value="-Pgpg"/>
<arg value="-s${settings_xml}"/>
</artifact:mvn>
</sequential>
</macrodef>
<macrodef name="nexus-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=${staging_repo_url}"/>
<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"/>
<arg value="-s${settings_xml}"/>
</artifact:mvn>
</sequential>
</macrodef>
<target name="stage" depends="apache.mvn-install, apache.tar"
description="deploy artifact to a nexus repository">
<nexus-plugin-no-classifier maven-jar="${build.dir}/${dest.jar}"
pomname="${sqoop.pom}"/>
<nexus-plugin
maven-jar="${build.srcjar.dir}/${artifact.name}-sources.jar"
pomname="${sqoop.pom}" attachas="sources"/>
<nexus-plugin-no-classifier
maven-jar="${build.dir}/${test.jar}" pomname="${sqooptest.pom}"/>
<nexus-plugin
maven-jar="${build.srcjar.dir}/${name}-test-${version}-sources.jar"
pomname="${sqooptest.pom}" attachas="sources"/>
</target>
</project>