forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build-maven.xml
271 lines (226 loc) · 7.95 KB
/
build-maven.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<?xml version="1.0"?>
<project name="portal-maven" default="zip-maven" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-common.xml" />
<taskdef classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="lib.classpath" name="xmltask" />
<condition property="gpg.extension" value=".exe" else="">
<contains string="${os.name}" substring="Windows" casesensitive="false" />
</condition>
<property name="gpg.executable" value="gpg${gpg.extension}" />
<condition property="maven.extension" value=".bat" else="">
<contains string="${os.name}" substring="Windows" casesensitive="false" />
</condition>
<property name="maven.executable" value="mvn${maven.extension}" />
<target name="deploy-artifacts">
<if>
<equals arg1="${gpg.keyname}" arg2="" />
<then>
<fail>
.
Set the properties "gpg.keyname" and "gpg.passphrase" in
release.${user.name}.properties.
See http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven
for GPG setup instructions.
</fail>
</then>
</if>
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<antcall target="prepare-maven">
<param name="tstamp.value" value="${tstamp.value}" />
</antcall>
<ant dir="${tstamp.value}" target="deploy" inheritall="false" />
<delete dir="${tstamp.value}" />
</target>
<target name="deploy-release-artifacts">
<antcall target="deploy-artifacts">
<param name="lp.maven.repository.id" value="${lp.maven.release.repository.id}" />
<param name="lp.maven.repository.url" value="${lp.maven.release.repository.url}" />
<param name="lp.maven.version" value="${lp.version}" />
</antcall>
</target>
<target name="deploy-snapshot-artifacts">
<antcall target="deploy-artifacts">
<param name="lp.maven.repository.id" value="${lp.maven.snapshot.repository.id}" />
<param name="lp.maven.repository.url" value="${lp.maven.snapshot.repository.url}" />
<param name="lp.maven.version" value="${lp.version}-SNAPSHOT" />
</antcall>
</target>
<target name="install-artifacts">
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<antcall target="prepare-maven">
<param name="lp.maven.repository.id" value="" />
<param name="lp.maven.repository.url" value="" />
<param name="tstamp.value" value="${tstamp.value}" />
</antcall>
<ant dir="${tstamp.value}" target="install" inheritall="false" />
<delete dir="${tstamp.value}" />
</target>
<target name="install-release-artifacts">
<antcall target="install-artifacts">
<param name="lp.maven.version" value="${lp.version}" />
</antcall>
</target>
<target name="install-snapshot-artifacts">
<antcall target="install-artifacts">
<param name="lp.maven.version" value="${lp.version}-SNAPSHOT" />
</antcall>
</target>
<target name="jar-javadoc">
<ant dir="portal-client" target="jar-javadoc" inheritAll="false" />
<ant dir="portal-impl" target="jar-javadoc" inheritAll="false" />
<ant dir="portal-pacl" target="jar-javadoc" inheritAll="false" />
<ant dir="portal-service" target="jar-javadoc" inheritAll="false" />
<ant dir="support-tomcat" target="jar-javadoc" inheritAll="false" />
<ant dir="util-bridges" target="jar-javadoc" inheritAll="false" />
<ant dir="util-java" target="jar-javadoc" inheritAll="false" />
<ant dir="util-slf4j" target="jar-javadoc" inheritAll="false" />
<ant dir="util-taglib" target="jar-javadoc" inheritAll="false" />
</target>
<target name="jar-sources">
<ant dir="portal-client" target="jar-sources" inheritAll="false" />
<ant dir="portal-impl" target="jar-sources" inheritAll="false" />
<ant dir="portal-pacl" target="jar-sources" inheritAll="false" />
<ant dir="portal-service" target="jar-sources" inheritAll="false" />
<ant dir="support-tomcat" target="jar-sources" inheritAll="false" />
<ant dir="util-bridges" target="jar-sources" inheritAll="false" />
<ant dir="util-java" target="jar-sources" inheritAll="false" />
<ant dir="util-slf4j" target="jar-sources" inheritAll="false" />
<ant dir="util-taglib" target="jar-sources" inheritAll="false" />
</target>
<target name="prepare-maven">
<if>
<not>
<available file="dist/liferay-portal-${lp.version}.war" />
</not>
<then>
<fail>
.
dist/liferay-portal-${lp.version}.war is not available.
Run "ant -f build-dist.xml all zip-portal-war" to generate that file.
</fail>
</then>
</if>
<antcall target="jar-javadoc" />
<antcall target="jar-sources" />
<ant dir="util-taglib" target="taglibdoc" inheritAll="false" />
<mkdir dir="${tstamp.value}" />
<copy todir="${tstamp.value}">
<fileset
dir="tools/maven"
includes="build.xml,readme.txt"
/>
</copy>
<copy file="tools/maven/build.properties" tofile="${tstamp.value}/build.properties">
<filterset>
<filter token="gpg.keyname" value="" />
<filter token="gpg.passphrase" value="" />
<filter token="repository.id" value="${lp.maven.repository.id}" />
<filter token="repository.url" value="${lp.maven.repository.url}" />
<filter token="version" value="${lp.maven.version}" />
</filterset>
</copy>
<mkdir dir="${tstamp.value}/dist" />
<copy todir="${tstamp.value}/dist">
<fileset
dir="lib/portal"
includes="portal-client.jar"
/>
<fileset
dir="portal-client"
includes="portal-client-javadoc.jar,portal-client-sources.jar"
/>
<fileset
dir="portal-impl"
includes="portal-impl.jar,portal-impl-javadoc.jar,portal-impl-sources.jar"
/>
<fileset
dir="portal-pacl"
includes="portal-pacl.jar,portal-pacl-javadoc.jar,portal-pacl-sources.jar"
/>
<fileset
dir="portal-service"
includes="portal-service.jar,portal-service-javadoc.jar,portal-service-sources.jar"
/>
<fileset
dir="support-tomcat"
includes="support-tomcat.jar,support-tomcat-javadoc.jar,support-tomcat-sources.jar"
/>
<fileset
dir="util-bridges"
includes="util-bridges.jar,util-bridges-javadoc.jar,util-bridges-sources.jar"
/>
<fileset
dir="util-java"
includes="util-java.jar,util-java-javadoc.jar,util-java-sources.jar"
/>
<fileset
dir="util-slf4j"
includes="util-slf4j.jar,util-slf4j-javadoc.jar,util-slf4j-sources.jar"
/>
<fileset
dir="util-taglib"
includes="util-taglib.jar,util-taglib-javadoc.jar,util-taglib-sources.jar"
/>
</copy>
<copy
file="dist/liferay-portal-${lp.version}.war"
tofile="${tstamp.value}/dist/portal-web.war"
/>
<zip destfile="${tstamp.value}/dist/util-taglib-tlddoc.jar">
<zipfileset dir="${doc.dir}/taglibs" />
</zip>
<copy todir="${tstamp.value}/dist">
<fileset dir="tools/maven" excludes="build.*,readme.txt" />
<filterset>
<filter token="version" value="${lp.maven.version}" />
</filterset>
<mapper>
<chainedmapper>
<mapper type="glob" from="*.xml" to="*.pom" />
</chainedmapper>
</mapper>
</copy>
<mkdir dir="${tstamp.value}/lib" />
<copy todir="${tstamp.value}/lib">
<fileset
dir="lib/development"
includes="ant-contrib.jar,antelope.jar"
/>
</copy>
<mkdir dir="${tstamp.value}/license" />
<copy todir="${tstamp.value}/license">
<fileset
dir="lib"
includes="versions.html"
/>
<fileset
dir="."
includes="copyright.txt"
/>
</copy>
</target>
<target name="zip-maven">
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<antcall target="prepare-maven">
<param name="gpg.keyname" value="" />
<param name="gpg.passphrase" value="" />
<param name="lp.maven.repository.id" value="liferay" />
<param name="lp.maven.repository.url" value="http://localhost/nexus/content/repositories/liferay-release" />
<param name="lp.maven.version" value="${lp.version}" />
<param name="tstamp.value" value="${tstamp.value}" />
</antcall>
<mkdir dir="dist" />
<zip destfile="dist/liferay-portal-maven-${lp.version}.zip">
<zipfileset
dir="${tstamp.value}"
prefix="liferay-portal-maven-${lp.version}"
/>
</zip>
<delete dir="${tstamp.value}" />
</target>
</project>