forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-maven.xml
286 lines (241 loc) · 7.54 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<?xml version="1.0"?>
<project default="zip-maven" name="portal-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 else="" property="gpg.extension" value=".exe">
<contains casesensitive="false" string="${os.name}" substring="Windows" />
</condition>
<property name="gpg.executable" value="gpg${gpg.extension}" />
<condition else="" property="maven.extension" value=".bat">
<contains casesensitive="false" string="${os.name}" substring="Windows" />
</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 pattern="yyyyMMddkkmmssSSS" property="tstamp.value" />
</tstamp>
<antcall target="prepare-maven">
<param name="tstamp.value" value="${tstamp.value}" />
</antcall>
<ant dir="${tstamp.value}" inheritall="false" target="deploy" />
<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 pattern="yyyyMMddkkmmssSSS" property="tstamp.value" />
</tstamp>
<antcall target="prepare-maven">
<param name="lp.maven.repository.id" value="" />
<param name="lp.maven.repository.url" value="" />
<param name="lp.maven.version" value="${lp.maven.version}" />
<param name="tstamp.value" value="${tstamp.value}" />
</antcall>
<ant dir="${tstamp.value}" inheritall="false" target="install" />
<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-impl" inheritAll="false" target="jar-javadoc" />
<ant dir="portal-kernel" inheritAll="false" target="jar-javadoc" />
<ant dir="support-tomcat" inheritAll="false" target="jar-javadoc" />
<ant dir="util-bridges" inheritAll="false" target="jar-javadoc" />
<ant dir="util-java" inheritAll="false" target="jar-javadoc" />
<ant dir="util-slf4j" inheritAll="false" target="jar-javadoc" />
<ant dir="util-taglib" inheritAll="false" target="jar-javadoc" />
</target>
<target name="jar-sources">
<ant dir="portal-impl" inheritAll="false" target="jar-sources" />
<ant dir="portal-kernel" inheritAll="false" target="jar-sources" />
<ant dir="support-tomcat" inheritAll="false" target="jar-sources" />
<ant dir="util-bridges" inheritAll="false" target="jar-sources" />
<ant dir="util-java" inheritAll="false" target="jar-sources" />
<ant dir="util-slf4j" inheritAll="false" target="jar-sources" />
<ant dir="util-taglib" inheritAll="false" target="jar-sources" />
</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" inheritAll="false" target="taglibdoc" />
<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="portal-impl"
includes="portal-impl.jar,portal-impl-javadoc.jar,portal-impl-sources.jar"
/>
<fileset
dir="portal-kernel"
includes="portal-kernel.jar,portal-kernel-javadoc.jar,portal-kernel-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
from="*.xml"
to="*.pom"
type="glob"
/>
</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 pattern="yyyyMMddkkmmssSSS" property="tstamp.value" />
</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>