Update pom files in master to 1.7.0-SNAPSHOT
[demo.git] / vnfs / honeycomb_plugin / parent-pom / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ~ Copyright (c) 2016 Cisco and/or its affiliates.
4   ~
5   ~ Licensed under the Apache License, Version 2.0 (the "License");
6   ~ you may not use this file except in compliance with the License.
7   ~ You may obtain a copy of the License at:
8   ~
9   ~     http://www.apache.org/licenses/LICENSE-2.0
10   ~
11   ~ Unless required by applicable law or agreed to in writing, software
12   ~ distributed under the License is distributed on an "AS IS" BASIS,
13   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   ~ See the License for the specific language governing permissions and
15   ~ limitations under the License.
16   -->
17
18 <!--
19     Modifications copyright © 2017 AT&T Intellectual Property
20 -->
21
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24
25
26 <parent>
27     <groupId>org.onap.demo.vnf</groupId>
28     <artifactId>demo-aggregator</artifactId>
29     <version>1.7.0-SNAPSHOT</version>
30     <relativePath>../../../pom.xml</relativePath>
31 </parent>
32
33     <properties>
34         <nexusproxy>http://nexus.fd.io/content</nexusproxy>
35         <start.script.template>
36 #!/bin/sh -
37 STATUS=100
38
39 while [ $STATUS -eq 100 ]
40 do
41   %s
42   STATUS=$?
43   echo "Honeycomb exited with status: $STATUS"
44   if [ $STATUS -eq 100 ]
45   then
46     echo "Restarting..."
47   fi
48 done
49         </start.script.template>
50         <exec.parameters>-Xms32m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
51         <exec.parameters.minimal>-client -Xms20m -Xmx32m -XX:MetaspaceSize=5m -XX:MaxMetaspaceSize=32m -XX:MaxMetaspaceExpansion=1m -Xss512k -XX:+UseSerialGC -Djava.compiler=NONE -Xverify:none -noverify</exec.parameters.minimal>
52         <debug.parameters>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debug.parameters>
53         <guice.version>4.1.0</guice.version>
54         <guice.config.version>1.2.0</guice.config.version>
55         <jersey.version>1.19.1</jersey.version>
56         <jetty.version>9.3.11.v20160721</jetty.version>
57         <servlet.version>3.1.0</servlet.version>
58     </properties>
59
60     <modelVersion>4.0.0</modelVersion>
61     <artifactId>hc-onap</artifactId>
62     <packaging>pom</packaging>
63
64     <!-- Generate executable shell script -->
65   <modules>
66     <module>../stream-count/stream-count-api</module>
67     <module>../stream-count/stream-count-impl</module>
68     <module>../stream-count/stream-count-distribution</module>
69     <module>../../vLBMS/apis/vlb-business-vnf-onap-plugin/vlb-business-vnf-onap-plugin-api</module>
70     <module>../../vLBMS/apis/vlb-business-vnf-onap-plugin/vlb-business-vnf-onap-plugin-impl</module>
71     <module>../../vLBMS/apis/health-vnf-onap-plugin/health-vnf-onap-plugin-api</module>
72     <module>../../vLBMS/apis/health-vnf-onap-plugin/health-vnf-onap-plugin-impl</module>
73     <module>../../vLBMS/apis/vlb-vnf-onap-distribution</module>
74   </modules>
75
76     <build>
77         <pluginManagement>
78             <plugins>
79                 <plugin>
80                     <groupId>org.apache.maven.plugins</groupId>
81                     <artifactId>maven-compiler-plugin</artifactId>
82                     <version>3.3</version>
83                     <configuration>
84                         <!-- Use google's error-prone static analysis-->
85                         <compilerId>javac-with-errorprone</compilerId>
86                         <forceJavacCompilerUse>true</forceJavacCompilerUse>
87                         <showWarnings>true</showWarnings>
88                         <source>1.8</source>
89                         <target>1.8</target>
90                     </configuration>
91                     <dependencies>
92                         <dependency>
93                             <groupId>org.codehaus.plexus</groupId>
94                             <artifactId>plexus-compiler-javac-errorprone</artifactId>
95                             <version>2.5</version>
96                         </dependency>
97                         <!-- override plexus-compiler-javac-errorprone's dependency on
98                              Error Prone with the latest version -->
99                         <dependency>
100                             <groupId>com.google.errorprone</groupId>
101                             <artifactId>error_prone_core</artifactId>
102                             <version>2.0.9</version>
103                         </dependency>
104                     </dependencies>
105                 </plugin>
106                 <plugin>
107                     <groupId>org.apache.maven.plugins</groupId>
108                     <artifactId>maven-jar-plugin</artifactId>
109                     <version>2.6</version>
110                     <configuration>
111                         <archive>
112                             <manifest>
113                                 <mainClass>${main.class}</mainClass>
114                                 <addClasspath>true</addClasspath>
115                                 <classpathPrefix>lib/</classpathPrefix>
116                                 <useUniqueVersions>false</useUniqueVersions>
117                                 <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
118                             </manifest>
119                             <manifestEntries>
120                                 <Class-Path>config/ cert/</Class-Path>
121                             </manifestEntries>
122                         </archive>
123                     </configuration>
124                 </plugin>
125
126                 <!-- Copy all dependencies -->
127                 <plugin>
128                     <groupId>org.apache.maven.plugins</groupId>
129                     <artifactId>maven-dependency-plugin</artifactId>
130                     <version>2.10</version>
131                     <executions>
132                         <execution>
133                             <id>copy-dependencies</id>
134                             <phase>package</phase>
135                             <goals>
136                                 <goal>copy-dependencies</goal>
137                             </goals>
138                             <configuration>
139                                 <outputDirectory>${project.build.directory}/lib</outputDirectory>
140                                 <useBaseVersion>true</useBaseVersion>
141                                 <useRepositoryLayout>true</useRepositoryLayout>
142                                 <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
143                             </configuration>
144                         </execution>
145                         <execution>
146                             <id>unpack-configuration</id>
147                             <phase>prepare-package</phase>
148                             <goals>
149                                 <goal>unpack-dependencies</goal>
150                             </goals>
151                             <configuration>
152                                 <includes>**/honeycomb-minimal-resources/</includes>
153                                 <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
154                             </configuration>
155                         </execution>
156                     </executions>
157                 </plugin>
158
159                 <!-- Generate shell script -->
160                 <plugin>
161                     <groupId>org.codehaus.gmaven</groupId>
162                     <artifactId>groovy-maven-plugin</artifactId>
163                     <version>2.0</version>
164                     <executions>
165                         <execution>
166                             <phase>package</phase>
167                             <goals>
168                                 <goal>execute</goal>
169                             </goals>
170                             <configuration>
171                                 <!-- TODO add remote debug option -->
172                                 <!-- TODO add clean option -->
173                                 <!-- TODO add shutdown script -->
174                                 <!-- TODO add restart script -->
175                                 <!-- TODO pass options to JVM? -->
176                                 <source>
177                                     import java.nio.file.Paths
178
179                                     log.info "Generating shell exec script"
180                                     def scriptTemplate = properties.getOrDefault("start.script.template", "")
181                                     def args = properties.getOrDefault("exec.parameters", "")
182                                     log.debug "Additional shell exec script properties: ${args}"
183                                     def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
184                                     def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
185                                     scriptParent.toFile().mkdirs()
186                                     def scriptContent = "java " + javaArgs
187                                     log.info "Generating shell exec script as ${scriptContent}"
188                                     def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
189                                     log.info "Writing shell exec script to ${scriptPath}"
190                                     scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
191                                     scriptPath.toFile().setExecutable(true)
192
193                                     scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
194                                     log.info "Writing shell exec script to ${scriptPath}"
195                                     scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
196                                     scriptPath.toFile().setExecutable(true)
197
198                                     def debug_args = properties.getOrDefault("debug.parameters", "")
199                                     def debugScriptContent = "java" + " ${debug_args} " + javaArgs
200                                     log.info "Generating shell debug script as ${debugScriptContent}"
201                                     scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
202                                     log.info "Writing shell debug script to ${scriptPath}"
203                                     scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
204                                     scriptPath.toFile().setExecutable(true)
205                                 </source>
206                             </configuration>
207                         </execution>
208                     </executions>
209                 </plugin>
210
211                 <!-- Build archives -->
212                 <plugin>
213                     <artifactId>maven-assembly-plugin</artifactId>
214                     <version>2.5.3</version>
215                     <dependencies>
216                         <dependency>
217                             <groupId>io.fd.honeycomb.common</groupId>
218                             <artifactId>minimal-assembly-descriptor</artifactId>
219                             <version>1.18.10</version>
220                         </dependency>
221                     </dependencies>
222                     <executions>
223                         <execution>
224                             <id>create-archive</id>
225                             <phase>package</phase>
226                             <goals>
227                                 <goal>single</goal>
228                             </goals>
229                             <configuration>
230                                 <descriptorRefs>
231                                     <descriptorRef>honeycomb-minimal</descriptorRef>
232                                 </descriptorRefs>
233                             </configuration>
234                         </execution>
235                     </executions>
236                 </plugin>
237
238                 <plugin>
239                     <groupId>org.codehaus.mojo</groupId>
240                     <artifactId>exec-maven-plugin</artifactId>
241                     <executions>
242                         <execution>
243                             <phase>none</phase>
244                         </execution>
245                     </executions>
246                     <configuration>
247                         <skip>true</skip>
248                     </configuration>
249                 </plugin>
250             </plugins>
251         </pluginManagement>
252     </build>
253
254 </project>