Implement support for v10 model entities.
[aai/model-loader.git] / antBuild / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- 
3  Copyright (c) 2016 AT&T Intellectual Property. All rights reserved.
4 -->
5 <project>
6         <target name="runLocal">
7                 <java dir="${basedir}" fork="yes" newenvironment="true"
8                         failonerror="true" classname="com.att.ajsc.runner.Runner">
9                         <classpath
10                                 path="${classpath}:${basedir}/ajsc-shared-config/etc:${runAjscHome}/lib/ajsc-runner-${ajscRuntimeVersion}.jar" />
11
12                         <!-- Windows Users may need to add a jvmarg arg to create a temp directory 
13                                 properly. -->
14                         <!-- <jvmarg value="-Djava.io.tmpdir=C:/yourTempDirectory"/> -->
15
16                         <!-- Uncomment the following 2 jvmarg values to enable Remote Debugging. 
17                          -->
18                         <!-- <jvmarg value="-Xdebug" /> -->
19                         <!-- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5432" 
20                                 /> -->
21
22                         <jvmarg value="-XX:MaxPermSize=512m" />
23                         <jvmarg value="-Xmx1024m" />
24
25                         <!-- Main ajsc Variables below (Variables necessary for proper startup 
26                                 of AJSC) -->
27                         <env key="AJSC_HOME" value="${runAjscHome}" />
28                         <sysproperty key="AJSC_HOME" value="${runAjscHome}" />
29                         <!-- you may specify any external location for AJSC_CONF_HOME where etc 
30                                 folder & all other configs can be found under it. If not specified, it will 
31                                 default to AJSC_HOME -->
32                         <sysproperty key="AJSC_CONF_HOME" value="${basedir}/bundleconfig-local" />
33                         <sysproperty key="AJSC_SHARED_CONFIG" value="${basedir}/ajsc-shared-config" />
34
35                         <!-- Location of logback.xml file used for logging configurations. Please, 
36                                 note, when deploying a service to either CSI or NON-CSI environment, this 
37                                 system property will be set in sys-props.properties file. We are setting 
38                                 it here for running locally due to the ease of use of maven variable for 
39                                 basedir. -->
40                         <sysproperty key="logback.configurationFile"
41                                 value="${basedir}/ajsc-shared-config/etc/logback.xml" />
42
43                         <!-- Setting system properties for the AJSC external libs and properties 
44                                 folders below. When deploying to a node, these properties will be set within 
45                                 the bundleconfig/etc/sysprops/sys-props.properties file. However, when running 
46                                 locally, the ${basedir} substitution works more efficiently in this manner. -->
47                         <sysproperty key="AJSC_EXTERNAL_LIB_FOLDERS" value="${basedir}/target/commonLibs" />
48                         <sysproperty key="AJSC_EXTERNAL_PROPERTIES_FOLDERS"
49                                 value="${basedir}/ajsc-shared-config/etc" />
50
51                         <!-- End of Main ajsc Variables below (Variables necessary for proper 
52                                 startup of AJSC) -->
53
54                         <!-- Uncomment the following line to add oauthentication to your Service -->
55                         <!-- <sysproperty key="spring.profiles.active" value="oauth" /> -->
56
57                         <!-- If using Cassandra as Database, Enter the ip/host and port below 
58                                 based on your known configuration -->
59                         <!-- <sysproperty key="cassandra.ip" value="hostname" /> -->
60                         <!-- <sysproperty key="cassandra.port" value="9042" /> -->
61
62                         <!-- The APP_SERVLET_URL_PATTERN variable is defaulted to "/services" 
63                                 within the initial configuration of the AJSC. If you are changing the CamelServlet 
64                                 Filter within the ajsc-override-web.xml, you should use that url-pattern 
65                                 here. This is necessary to properly register your service with dme2. An empty 
66                                 value, "", is used when NO value is wanted (url-pattern would be /* for CamelServlet 
67                                 Filter) -->
68                         <!-- As of 4.5.1, this property is no longer needed -->
69                         <!-- <sysproperty key="APP_SERVLET_URL_PATTERN" value="/services" /> -->
70
71                         <!-- GRM/DME2 System Properties below -->
72                         <sysproperty key="AJSC_SERVICE_NAMESPACE" value="${module.ajsc.namespace.name}" />
73                         <sysproperty key="AJSC_SERVICE_VERSION" value="${module.ajsc.namespace.version}" />
74                         <sysproperty key="SOACLOUD_SERVICE_VERSION" value="${project.version}" />
75                         <!-- End of GRM/DME2 System Property Variables -->
76
77                         <!-- The following server.port variable was necessary for the proper registration 
78                                 of the AJSC to dme2. This value may still need to be used if the Developer 
79                                 is hardcoding their port (example: 8080). Then, the server.port value="8080". 
80                                 The default functionality for the AJSC is to use EPHEMERAL ports. In this 
81                                 case, you do NOT need to set the server.port value. The AJSC will find the 
82                                 proper port value and register to dme2 correctly -->
83                         <!-- <sysproperty key="server.port" value="${serverPort}" /> -->
84
85                         <!-- Command Line Arguments to add to the java command. Here, you can 
86                                 specify the port as well as the Context you want your service to run in. 
87                                 Use context=/ to run in an unnamed Context (Root Context). The default configuration 
88                                 of the AJSC is to run under the /ajsc Context. Setting the port here can 
89                                 aid during the development phase of your service. However, you can leave 
90                                 this argument out entirely, and the AJSC will default to using an Ephemeral 
91                                 port. -->
92                         <arg line="context=/ port=${serverPort} sslport=${sslport}" />
93                 </java>
94         </target>
95         <target name="prep_home_directory_for_swm_pkgcreate">
96
97 <!-- ********* GENERATE CADI KEY AND ENCRYPTED PASSWORD ***********
98      
99             Uncomment the following if your cadi key get corrupted , It would 
100                         generate the Cadi key and password in the package phase and keep the key 
101                         in the 'src/main/config/ajscKey' and password in the bottom of cadi.properties(you 
102                         need to modify the 'aaf_pass' variable with this value . Plese modify the 
103                         template.cadi.properties as well before uploading to SOA node 
104 -->
105
106 <!-- 
107                 <java jar="${basedir}/target/userjars/cadi-core-1.2.5.jar" fork="true"> 
108                 <arg value="keygen" /> <arg value="src/main/config/ajscKey" /> 
109                 </java> 
110                 
111                 <echo>***Cadi Key file generated ****</echo> 
112                 
113                 <java jar="${basedir}/target/userjars/cadi-core-1.2.5.jar" 
114                 fork="true" append="true" output="${basedir}/src/main/config/cadi.properties"> 
115                 <arg value="digest" /> <arg value="ajscRocks!" /> <arg value="src/main/config/ajscKey" 
116                 /> 
117                 </java> 
118                 
119 -->
120
121
122
123                 <!-- These tasks are copying contents from the installHomeDirectory into 
124                         the eventual $AJSC_HOME directory for running locally and soa cloud installation -->
125                 <echo message="ENTERING 'prep_home_directory_for_swm_pkgcreate' ant tasks" />
126
127                 <!-- Please, NOTE: The ajsc-archetype is setup for a default CSI Env deployment. 
128                         If you are deploying to a CSI Env, you should NOT have to change anything 
129                         within this build file. However, if you are NOT deploying to a CSI Env, you 
130                         should comment OUT the CSI related portion of this build.xml. -->
131
132                 <!-- The following code snippet is copying the bundleconfig-csi directory 
133                         to the proper installation/bundleconfig directory used in CSI envs. If you 
134                         are NOT installing to a CSI node, you should comment out (or delete) the 
135                         following snippet, and uncomment the NON-CSI copy task to copy EVERYTHING 
136                         to the installation/bundleconfig directory. -->
137
138                 <!-- CSI related bundleconfig copy task. If you are NOT deploying to a 
139                         CSI Env, please COMMENT OUT or delete the following copy task code snippet. -->
140                 <!--<copy toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig" 
141                         failonerror="true"> <fileset dir="${basedir}/bundleconfig-csi" /> </copy> -->
142                 <!-- End of CSI related bundleconfig copy task -->
143
144                 <!-- NOTE: If you are NOT deploying to CSI environment, and you are NOT 
145                         using an AJSC_SHARED_CONFIG location on a node, you should go ahead and copy 
146                         EVERYTHING from bundleconfig and ajsc-shared-config (logback.xml) directory 
147                         to utilize proper logging from logback.xml. Simply, uncomment the following 
148                         code snippet below to copy EVERYTHING and comment out the CSI related build 
149                         script above. -->
150                 <!-- NON-CSI related build copy task. Please, uncomment the following code 
151                         snippet to deploy the proper artifacts to a NON-CSI Env. -->
152                 <copy
153                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig"
154                         failonerror="true">
155                         <fileset dir="${basedir}/bundleconfig-local" includes="**/**" />
156                 </copy>
157                 <copy
158                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/bundleconfig/etc"
159                         failonerror="true">
160                         <fileset dir="${basedir}/ajsc-shared-config/etc" includes="**/**" />
161                 </copy>
162                 <!-- End of NON-CSI related build copy task. -->
163
164                 <!-- Copying any zips (deployment packages) to $AJSC_HOME/services for 
165                         auto-deployment -->
166                 <copy
167                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/services"
168                         failonerror="false">
169                         <fileset dir="${basedir}/services" includes="*.zip" />
170                 </copy>
171
172                 <!-- Copying runtimeEnvironment zip file to $AJSC_HOME/runtime and renaming 
173                         runtimeEnvironment.zip for proper auto-deployment of ajsc services. 
174                 <copy
175                         tofile="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/runtime/runtimeEnvironment.zip">
176                         <fileset dir="target" includes="*-runtimeEnvironment.zip" />
177                 </copy>-->
178
179                 <!-- Copying dependencies from the service project (not provided by AJSC 
180                         Container) to the $AJSC_HOME/extJars folder to be accessible on the classpath -->
181                 <copy
182                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extJars"
183                         failonerror="false">
184                         <fileset dir="target/userjars" includes="*" />
185                 </copy>
186
187                 <!-- extApps directory MUST be created for ajsc-runner to run correctly, 
188                         even if empty. DO NOT REMOVE!!! -->
189                 <!-- extApps directory created to deploy other war files on startup or 
190                         hot deploy War files after ajsc starts up. -->
191                 <mkdir
192                         dir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extApps" />
193
194                 <!-- Copying any extra wars to $AJSC_HOME/extApps to be deployed within 
195                         AJSC -->
196                 <copy
197                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extApps"
198                         failonerror="false">
199                         <fileset dir="${basedir}/src/main/resources/extApps"
200                                 includes="*" />
201                 </copy>
202
203                 <!-- staticContent folder is for serving static content within an ajsc 
204                         service. Any static content to be served will be copyied to the ultimate 
205                         $AJSC_HOME/staticContent folder and can be served with the att-static-content 
206                         camel component. -->
207                 <!-- Uncomment the following snippet to copy items from staticContent folder 
208                         to ultimate $AJSC_HOME/staticConent -->
209                 <!-- <copy toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/staticContent" 
210                         failonerror="false"> <fileset dir="${basedir}/staticContent" includes="**/**" 
211                         /> </copy> -->
212
213                 <!-- Copying extra jar files that have been labeled as dependencies in 
214                         service project to /extJars folder to be made available on the classpath 
215                         for your service -->
216                 <copy
217                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/extJars"
218                         failonerror="false">
219                         <fileset dir="target" includes="*.jar" />
220                 </copy>
221
222                 <!-- Copying deployment packages created within the project to the $AJSC_HOME/services 
223                         folder to be auto deployed. -->
224                 <copy
225                         toDir="${basedir}/target/swm/package/nix/dist_files${distFilesRoot}/services">
226                         <fileset dir="target" includes="*.zip" excludes="*-runtimeEnvironment.zip" />
227                 </copy>
228
229                 <echo message="EXITING 'prep_assembly_output_for_swm_plugin' ant tasks" />
230         </target>
231 </project>