Bump version to 1.1.2-SNAPSHOT
[demo.git] / vnfs / honeycomb_plugin / sample_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.1.2-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         <restconf.version>1.3.2-Beryllium-SR2</restconf.version>
56         <netconf.version>1.0.2-Beryllium-SR2</netconf.version>
57         <jersey.version>1.19.1</jersey.version>
58         <jetty.version>9.3.11.v20160721</jetty.version>
59         <servlet.version>3.1.0</servlet.version>
60         <yangtools.version>0.8.2-Beryllium-SR2</yangtools.version>
61         <mdsal.version>1.3.2-Beryllium-SR2</mdsal.version>
62         <!-- Used by mdsal as provided/runtime dependency-->
63         <osgi.core.version>5.0.0</osgi.core.version>
64     </properties>
65
66     <modelVersion>4.0.0</modelVersion>
67     <artifactId>hc-onap</artifactId>
68     <packaging>pom</packaging>
69
70     <!-- Generate executable shell script -->
71   <modules>
72     <module>../sample-plugin-api</module>
73     <module>../sample-plugin-impl</module>
74     <module>../sample-distribution</module>
75   </modules>
76
77     <build>
78         <pluginManagement>
79             <plugins>
80                 <plugin>
81                     <groupId>org.apache.maven.plugins</groupId>
82                     <artifactId>maven-compiler-plugin</artifactId>
83                     <version>3.3</version>
84                     <configuration>
85                         <!-- Use google's error-prone static analysis-->
86                         <compilerId>javac-with-errorprone</compilerId>
87                         <forceJavacCompilerUse>true</forceJavacCompilerUse>
88                         <showWarnings>true</showWarnings>
89                         <source>1.8</source>
90                         <target>1.8</target>
91                     </configuration>
92                     <dependencies>
93                         <dependency>
94                             <groupId>org.codehaus.plexus</groupId>
95                             <artifactId>plexus-compiler-javac-errorprone</artifactId>
96                             <version>2.5</version>
97                         </dependency>
98                         <!-- override plexus-compiler-javac-errorprone's dependency on
99                              Error Prone with the latest version -->
100                         <dependency>
101                             <groupId>com.google.errorprone</groupId>
102                             <artifactId>error_prone_core</artifactId>
103                             <version>2.0.9</version>
104                         </dependency>
105                     </dependencies>
106                 </plugin>
107                 <plugin>
108                     <groupId>org.apache.maven.plugins</groupId>
109                     <artifactId>maven-jar-plugin</artifactId>
110                     <version>2.6</version>
111                     <configuration>
112                         <archive>
113                             <manifest>
114                                 <mainClass>${main.class}</mainClass>
115                                 <addClasspath>true</addClasspath>
116                                 <classpathPrefix>lib/</classpathPrefix>
117                                 <useUniqueVersions>false</useUniqueVersions>
118                                 <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
119                             </manifest>
120                             <manifestEntries>
121                                 <Class-Path>config/ cert/</Class-Path>
122                             </manifestEntries>
123                         </archive>
124                     </configuration>
125                 </plugin>
126
127                 <!-- Copy all dependencies -->
128                 <plugin>
129                     <groupId>org.apache.maven.plugins</groupId>
130                     <artifactId>maven-dependency-plugin</artifactId>
131                     <version>2.10</version>
132                     <executions>
133                         <execution>
134                             <id>copy-dependencies</id>
135                             <phase>package</phase>
136                             <goals>
137                                 <goal>copy-dependencies</goal>
138                             </goals>
139                             <configuration>
140                                 <outputDirectory>${project.build.directory}/lib</outputDirectory>
141                                 <useBaseVersion>true</useBaseVersion>
142                                 <useRepositoryLayout>true</useRepositoryLayout>
143                                 <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
144                             </configuration>
145                         </execution>
146                         <execution>
147                             <id>unpack-configuration</id>
148                             <phase>prepare-package</phase>
149                             <goals>
150                                 <goal>unpack-dependencies</goal>
151                             </goals>
152                             <configuration>
153                                 <includes>**/honeycomb-minimal-resources/</includes>
154                                 <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
155                             </configuration>
156                         </execution>
157                     </executions>
158                 </plugin>
159
160                 <!-- Generate shell script -->
161                 <plugin>
162                     <groupId>org.codehaus.gmaven</groupId>
163                     <artifactId>groovy-maven-plugin</artifactId>
164                     <version>2.0</version>
165                     <executions>
166                         <execution>
167                             <phase>package</phase>
168                             <goals>
169                                 <goal>execute</goal>
170                             </goals>
171                             <configuration>
172                                 <!-- TODO add remote debug option -->
173                                 <!-- TODO add clean option -->
174                                 <!-- TODO add shutdown script -->
175                                 <!-- TODO add restart script -->
176                                 <!-- TODO pass options to JVM? -->
177                                 <source>
178                                     import java.nio.file.Paths
179
180                                     log.info "Generating shell exec script"
181                                     def scriptTemplate = properties.getOrDefault("start.script.template", "")
182                                     def args = properties.getOrDefault("exec.parameters", "")
183                                     log.debug "Additional shell exec script properties: ${args}"
184                                     def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
185                                     def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
186                                     scriptParent.toFile().mkdirs()
187                                     def scriptContent = "java " + javaArgs
188                                     log.info "Generating shell exec script as ${scriptContent}"
189                                     def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
190                                     log.info "Writing shell exec script to ${scriptPath}"
191                                     scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
192                                     scriptPath.toFile().setExecutable(true)
193
194                                     scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
195                                     log.info "Writing shell exec script to ${scriptPath}"
196                                     scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
197                                     scriptPath.toFile().setExecutable(true)
198
199                                     def debug_args = properties.getOrDefault("debug.parameters", "")
200                                     def debugScriptContent = "java" + " ${debug_args} " + javaArgs
201                                     log.info "Generating shell debug script as ${debugScriptContent}"
202                                     scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
203                                     log.info "Writing shell debug script to ${scriptPath}"
204                                     scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
205                                     scriptPath.toFile().setExecutable(true)
206                                 </source>
207                             </configuration>
208                         </execution>
209                     </executions>
210                 </plugin>
211
212                 <!-- Build archives -->
213                 <plugin>
214                     <artifactId>maven-assembly-plugin</artifactId>
215                     <version>2.5.3</version>
216                     <dependencies>
217                         <dependency>
218                             <groupId>io.fd.honeycomb.common</groupId>
219                             <artifactId>minimal-assembly-descriptor</artifactId>
220                             <version>1.16.9</version>
221                         </dependency>
222                     </dependencies>
223                     <executions>
224                         <execution>
225                             <id>create-archive</id>
226                             <phase>package</phase>
227                             <goals>
228                                 <goal>single</goal>
229                             </goals>
230                             <configuration>
231                                 <descriptorRefs>
232                                     <descriptorRef>honeycomb-minimal</descriptorRef>
233                                 </descriptorRefs>
234                             </configuration>
235                         </execution>
236                     </executions>
237                 </plugin>
238
239                 <plugin>
240                     <groupId>org.codehaus.mojo</groupId>
241                     <artifactId>exec-maven-plugin</artifactId>
242                     <executions>
243                         <execution>
244                             <phase>none</phase>
245                         </execution>
246                     </executions>
247                     <configuration>
248                         <skip>true</skip>
249                     </configuration>
250                 </plugin>
251             </plugins>
252         </pluginManagement>
253     </build>
254
255 </project>