-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·238 lines (201 loc) · 13.8 KB
/
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
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
<project name="soa-p-provision" default="soa-p" basedir=".">
<property environment="ENV"/>
<property file="build.properties" />
<import file="base-build.xml" />
<target name="checkjboss.server.configuration">
<available file="${jboss.home}/server/${original.esb.server.runtime}/conf/jboss-service.xml" property="isjboss.server.configuration" />
<fail unless="isjboss.server.configuration" message="${jboss.home}/server/${original.esb.server.runtime} doesn't exist! .... please fix your $jboss.home environment variable!!" />
</target>
<target name="checkESB">
<available file="${jboss.home}/server/${original.esb.server.runtime}/deploy/jbossesb.sar" property="isESB" />
<fail unless="isESB" message="${jboss.home}/${original.esb.server.runtime}/deploy/jbossesb.sar doesn't exist! .... please ensure the ESB artifacts are deployed in the JBoss App Platform or you are using SOA-P !!" />
</target>
<target name="clean" description="Cleans JBoss directories">
<delete dir="${jboss.home}/server/${jboss.server.configuration}/log" />
<delete dir="${jboss.home}/server/${jboss.server.configuration}/data" />
<delete dir="${jboss.home}/server/${jboss.server.configuration}/work" />
<delete dir="${jboss.home}/server/${jboss.server.configuration}/tmp" />
<delete dir="${runtime.lib.dir}" />
<delete dir="${jboss.server.deploy.dir}/${organization.name}" />
</target>
<!-- create a clone of the JBoss EAP 'default' config and name it the value of ${jboss.server.configuration} -->
<target name="clone.jboss" >
<delete dir="${jboss.home}/server/${jboss.server.configuration}" />
<copy overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}">
<fileset dir="${jboss.home}/server/${original.esb.server.runtime}" />
</copy>
</target>
<condition property="useHornetQ" >
<equals arg1="${org.jboss.spp.messagingProvider}" arg2="HORNETQ" />
</condition>
<target name="hornetq-server-config" depends="" description="configure standalone hornetq" if="useHornetQ" >
<!-- ******************** modify various HornetQ provider configs ************ -->
<antcall target="filter">
<param name="source.dir" value="conf/hornetq"/>
<param name="file.name" value="run.sh"/>
<param name="dest.dir" value="${HORNETQ_HOME}/bin"/>
</antcall>
<antcall target="filter">
<param name="source.dir" value="conf/hornetq"/>
<param name="file.name" value="hornetq-configuration.xml"/>
<param name="dest.dir" value="${HORNETQ_HOME}/config/stand-alone/clustered"/>
</antcall>
<antcall target="filter">
<param name="source.dir" value="conf/hornetq"/>
<param name="file.name" value="hornetq-jms.xml"/>
<param name="dest.dir" value="${HORNETQ_HOME}/config/stand-alone/clustered"/>
</antcall>
<copy file="conf/hornetq/hornetq-users.xml" toDir="${HORNETQ_HOME}/config/stand-alone/clustered" overwrite="true" verbose="true" />
</target>
<target name="hornetq-soa-p-config" depends="" if="useHornetQ" >
<!-- **************** remove embedded JBoss Messaging *************** -->
<delete file="${jboss.home}/server/${jboss.server.configuration}/conf/props/messaging-roles.properties" />
<delete file="${jboss.home}/server/${jboss.server.configuration}/conf/props/messaging-users.properties" />
<delete dir="${jboss.home}/server/${jboss.server.configuration}/deploy/messaging/" />
<delete dir="${jboss.home}/server/${jboss.server.configuration}/deploy/jms-ra.rar" />
<delete file="${jboss.home}/server/${jboss.server.configuration}/deploy/quartz-ra.rar" />
<delete file="${jboss.home}/server/${jboss.server.configuration}/deployers/messaging-definitions-jboss-beans.xml" />
<copy file="conf/jbossEAP/conf/jbossts-properties.xml" overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}/conf" />
<copy toDir="${runtime.lib.dir}" overwrite="true" verbose="true" >
<fileset dir="${HORNETQ_HOME}/lib" >
<include name="hornetq-core-client.jar" />
<include name="netty.jar" />
<include name="hornetq-jms-client.jar" />
<include name="hornetq-core.jar" />
</fileset>
</copy>
<!-- ****************** add hornetq JCA resource adapater configs ************* -->
<unjar src="${HORNETQ_HOME}/lib/hornetq-ra.rar" dest="${jboss.home}/server/${jboss.server.configuration}/deploy/hornetq-ra.rar" />
<antcall target="filter">
<param name="source.dir" value="conf/hornetq"/>
<param name="file.name" value="ra.xml"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}/hornetq-ra.rar/META-INF"/>
</antcall>
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP/deploy"/>
<param name="file.name" value="hornetq-jms-ds.xml"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}"/>
</antcall>
</target>
<target name="eap-config" depends="" >
<mkdir dir="${runtime.lib.dir}" />
<mkdir dir="${jboss.server.deploy.dir}/${organization.name}" />
<copy file="conf/soa-p/conf/soa-users.properties" overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}/conf/props" />
<copy file="conf/jbossEAP/conf/jboss-log4j.xml" overwrite="true" todir="${jboss.server.conf.dir}"/>
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP/conf"/>
<param name="file.name" value="jboss-service.xml"/>
<param name="dest.dir" value="${jboss.server.conf.dir}"/>
</antcall>
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP/deploy"/>
<param name="file.name" value="properties-service.xml"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}"/>
</antcall>
<copy file="conf/jbossEAP/deployers/ejb-deployer-jboss-beans.xml" overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}/deployers/"/>
<copy file="conf/jbossEAP/deployers/metadata-deployer-jboss-beans.xml" overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}/deployers/"/>
<!-- ************* add PostgreSQL & Oracle JDBC libraries to JBoss classpath *************** -->
<copy toDir="${runtime.lib.dir}" overwrite="true" verbose="true" file="${jdbc.lib.path}" />
<copy file="lib/ojdbc14.jar" toDir="${runtime.lib.dir}" verbose="true" />
<!-- ************* change EJB2 and EJB3 Timers to use postgresql ****************** -->
<copy file="conf/jbossEAP/deploy/ejb2-timer-service.xml" toDir="${jboss.server.deploy.dir}" overwrite="true" />
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP"/>
<param name="file.name" value="run.conf"/>
<param name="dest.dir" value="${jboss.home}/server/${jboss.server.configuration}"/>
</antcall>
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP/deploy"/>
<param name="file.name" value="poc-ds.xml"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}"/>
</antcall>
<delete dir="${jboss.server.deploy.dir}/mail-ra-rar" />
<delete dir="${jboss.server.deploy.dir}/mail-service.xml" />
<delete file="${jboss.server.deploy.dir}/management" />
<delete dir="${jboss.server.deploy.dir}/uuid-key-generator.sar" />
</target>
<target name="deleteJBM_ESB_Queues" if="useHornetQ" >
<delete file="${jboss.server.deploy.dir}/jbossesb.esb/jbm-queue-service.xml" />
</target>
<target name="esb-config" >
<antcall target="deleteJBM_ESB_Queues" />
<copy file="conf/soa-p/deploy/jbossesb.esb/META-INF/deployment.xml" overwrite="true" todir="${jboss.server.deploy.dir}/jbossesb.esb/META-INF" />
<!-- *************** switch riftsaw to postgres ******************************* -->
<antcall target="filter">
<param name="source.dir" value="conf/soa-p/deploy/riftsaw.sar/META-INF"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}/riftsaw.sar/META-INF/"/>
</antcall>
<copy file="conf/soa-p/deploy/riftsaw.sar/bpel.properties" overwrite="true" todir="${jboss.server.deploy.dir}/riftsaw.sar/" />
<copy file="conf/soa-p/deploy/riftsaw.sar/META-INF/jboss-beans.xml" overwrite="true" todir="${jboss.server.deploy.dir}/riftsaw.sar/META-INF/" />
<!-- ************* remove ESB message / audit store ************************* -->
<delete file="${jboss.server.deploy.dir}/jbossesb.esb/message-store-ds.xml" />
<delete file="${jboss.server.deploy.dir}/jbossesb.esb/jbossesb-service.xml" />
<copy file="conf/soa-p/deploy/jbossesb.esb/META-INF/jboss-esb.xml" overwrite="true" todir="${jboss.server.deploy.dir}/jbossesb.esb/META-INF"/>
<!-- ************** create new PostgrSQL datastore for ESB and juddi ********************* -->
<antcall target="filter">
<param name="source.dir" value="conf/soa-p/deploy"/>
<param name="dest.dir" value="${jboss.server.deploy.dir}"/>
</antcall>
<if>
<equals arg1="${use_H2_for_esb_persistence}" arg2="false" />
<then>
<!-- *************** juddi registry now to use PostgreSQL rather than Hypersonic ****************** -->
<copy file="conf/soa-p/deploy/jbossesb-registry.sar/juddi-ds.xml" overwrite="true"
todir="${jboss.server.deploy.dir}/jbossesb-registry.sar" />
<copy file="conf/soa-p/deploy/jbossesb-registry.sar/juddi_config/META-INF/persistence.xml" overwrite="true"
todir="${jboss.server.deploy.dir}/jbossesb-registry.sar/juddi_config/META-INF" />
</then>
</if>
<!-- **************** turn off juddi cache expirary ************************ -->
<copy file="conf/soa-p/deployers/esb.deployer/jbossesb-properties.xml" overwrite="true" todir="${jboss.home}/server/${jboss.server.configuration}/deployers/esb.deployer" />
<!-- **************** wsdls should now point to Apache HTTPD ************************ -->
<antcall target="filter">
<param name="source.dir" value="conf/jbossEAP/deployers/jbossws.deployer/META-INF"/>
<param name="dest.dir" value="${jboss.home}/server/${jboss.server.configuration}/deployers/jbossws.deployer/META-INF"/>
</antcall>
<!-- **************** remove ejb2 stuff *************** -->
<delete file="${jboss.home}/server/${jboss.server.configuration}/deploy/ejb2-container-jboss-beans.xml" />
<delete dir="${jboss.server.deploy.dir}/jbpm.esb/" />
<delete dir="${jboss.server.deploy.dir}/spring.esb" />
<delete dir="${jboss.server.deploy.dir}/slsb.esb" />
</target>
<target name="install.mod.cluster.check">
<condition property="mod.cluster.not.available">
<not>
<available file="${mod.cluster.home}/" />
</not>
</condition>
</target>
<target name="install.mod.cluster" depends="install.mod.cluster.check" >
<gunzip src="${mod.cluster.archive}.gz" dest="${downloads.dir}" />
<untar src="${mod.cluster.archive}" dest="${mod.cluster.home}" />
</target>
<!--
NOTE: will use 'clustered' config of mod_cluster ..... which requires the use of HAParition
will copy appropriate HAPartition stuff from JBoss 'all' config
-->
<target name="addModCluster" description="configures JBoss with mod_cluster and jgroups" depends="install.mod.cluster" >
<!-- <copy overwrite="true" file="conf/jbossweb.sar/server.xml" toDir="${jboss.server.deploy.dir}/jbossweb.sar" verbose="true" /> -->
<copy toDir="${jboss.server.deploy.dir}/cluster/mod_cluster-1.1.1.sar" overwrite="true" verbose="true" >
<fileset dir="${mod.cluster.home}/mod_cluster.sar" />
</copy>
<copy file="${jboss.home}/server/all/lib/jbosscache-core.jar" toDir="${runtime.lib.dir}" verbose="true" />
<copy file="${jboss.home}/server/all/lib/jbosscache-pojo.jar" toDir="${runtime.lib.dir}" verbose="true" />
<copy file="${jboss.home}/server/all/lib/jgroups.jar" toDir="${runtime.lib.dir}" verbose="true" />
<copy file="${jboss.home}/server/all/deploy/cluster/hapartition-jboss-beans.xml" toDir="${jboss.server.deploy.dir}/cluster" verbose="true" />
<copy toDir="${jboss.server.deploy.dir}/cluster/jboss-cache-manager.sar" verbose="true" >
<fileset dir="${jboss.home}/server/all/deploy/cluster/jboss-cache-manager.sar" />
</copy>
<copy toDir="${jboss.server.deploy.dir}/cluster/jgroups-channelfactory.sar" verbose="true" >
<fileset dir="${jboss.home}/server/all/deploy/cluster/jgroups-channelfactory.sar" />
</copy>
<copy file="${mod.cluster.home}/demo/server/mod_cluster-demo-server-${mod.cluster.version}.war" toDir="${jboss.server.deploy.dir}/cluster/" verbose="true" />
</target>
<target name="soa-p" depends="checkESB,
clean,
clone.jboss,
eap-config,
esb-config,
hornetq-soa-p-config"
/>
</project>