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