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