1 <?xml version="1.0" encoding="UTF-8"?>
3 ~ Copyright (c) 2016 Cisco and/or its affiliates.
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:
9 ~ http://www.apache.org/licenses/LICENSE-2.0
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.
17 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22 <groupId>org.openecomp.demo.vnf</groupId>
23 <artifactId>demo-aggregator</artifactId>
24 <version>1.0.0-SNAPSHOT</version>
25 <relativePath>../../../../pom.xml</relativePath>
29 <!--nexusproxy>http://nexus.fd.io/content</nexusproxy-->
30 <start.script.template>
34 while [ $STATUS -eq 100 ]
38 echo "Honeycomb exited with status: $STATUS"
39 if [ $STATUS -eq 100 ]
44 </start.script.template>
45 <exec.parameters>-Xms32m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
46 <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>
47 <debug.parameters>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debug.parameters>
48 <guice.version>4.1.0</guice.version>
49 <guice.config.version>1.2.0</guice.config.version>
50 <restconf.version>1.3.2-Beryllium-SR2</restconf.version>
51 <netconf.version>1.0.2-Beryllium-SR2</netconf.version>
52 <jersey.version>1.19.1</jersey.version>
53 <jetty.version>9.3.11.v20160721</jetty.version>
54 <servlet.version>3.1.0</servlet.version>
55 <yangtools.version>0.8.2-Beryllium-SR2</yangtools.version>
56 <mdsal.version>1.3.2-Beryllium-SR2</mdsal.version>
57 <!-- Used by mdsal as provided/runtime dependency-->
58 <osgi.core.version>5.0.0</osgi.core.version>
61 <modelVersion>4.0.0</modelVersion>
62 <groupId>io.fd.honeycomb.common</groupId>
63 <artifactId>minimal-distribution-parent</artifactId>
64 <version>1.16.9</version>
65 <packaging>pom</packaging>
67 <!-- Generate executable shell script -->
69 <module>../sample-plugin-api</module>
70 <module>../sample-plugin-impl</module>
71 <module>../sample-distribution</module>
78 <groupId>org.apache.maven.plugins</groupId>
79 <artifactId>maven-compiler-plugin</artifactId>
80 <version>3.3</version>
82 <!-- Use google's error-prone static analysis-->
83 <compilerId>javac-with-errorprone</compilerId>
84 <forceJavacCompilerUse>true</forceJavacCompilerUse>
85 <showWarnings>true</showWarnings>
91 <groupId>org.codehaus.plexus</groupId>
92 <artifactId>plexus-compiler-javac-errorprone</artifactId>
93 <version>2.5</version>
95 <!-- override plexus-compiler-javac-errorprone's dependency on
96 Error Prone with the latest version -->
98 <groupId>com.google.errorprone</groupId>
99 <artifactId>error_prone_core</artifactId>
100 <version>2.0.9</version>
105 <groupId>org.apache.maven.plugins</groupId>
106 <artifactId>maven-jar-plugin</artifactId>
107 <version>2.6</version>
111 <mainClass>${main.class}</mainClass>
112 <addClasspath>true</addClasspath>
113 <classpathPrefix>lib/</classpathPrefix>
114 <useUniqueVersions>false</useUniqueVersions>
115 <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
118 <Class-Path>config/ cert/</Class-Path>
124 <!-- Copy all dependencies -->
126 <groupId>org.apache.maven.plugins</groupId>
127 <artifactId>maven-dependency-plugin</artifactId>
128 <version>2.10</version>
131 <id>copy-dependencies</id>
132 <phase>package</phase>
134 <goal>copy-dependencies</goal>
137 <outputDirectory>${project.build.directory}/lib</outputDirectory>
138 <useBaseVersion>true</useBaseVersion>
139 <useRepositoryLayout>true</useRepositoryLayout>
140 <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
144 <id>unpack-configuration</id>
145 <phase>prepare-package</phase>
147 <goal>unpack-dependencies</goal>
150 <includes>**/honeycomb-minimal-resources/</includes>
151 <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
157 <!-- Generate shell script -->
159 <groupId>org.codehaus.gmaven</groupId>
160 <artifactId>groovy-maven-plugin</artifactId>
161 <version>2.0</version>
164 <phase>package</phase>
169 <!-- TODO add remote debug option -->
170 <!-- TODO add clean option -->
171 <!-- TODO add shutdown script -->
172 <!-- TODO add restart script -->
173 <!-- TODO pass options to JVM? -->
175 import java.nio.file.Paths
177 log.info "Generating shell exec script"
178 def scriptTemplate = properties.getOrDefault("start.script.template", "")
179 def args = properties.getOrDefault("exec.parameters", "")
180 log.debug "Additional shell exec script properties: ${args}"
181 def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
182 def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
183 scriptParent.toFile().mkdirs()
184 def scriptContent = "java " + javaArgs
185 log.info "Generating shell exec script as ${scriptContent}"
186 def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
187 log.info "Writing shell exec script to ${scriptPath}"
188 scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
189 scriptPath.toFile().setExecutable(true)
191 scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
192 log.info "Writing shell exec script to ${scriptPath}"
193 scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &"
194 scriptPath.toFile().setExecutable(true)
196 def debug_args = properties.getOrDefault("debug.parameters", "")
197 def debugScriptContent = "java" + " ${debug_args} " + javaArgs
198 log.info "Generating shell debug script as ${debugScriptContent}"
199 scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
200 log.info "Writing shell debug script to ${scriptPath}"
201 scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
202 scriptPath.toFile().setExecutable(true)
209 <!-- Build archives -->
211 <artifactId>maven-assembly-plugin</artifactId>
212 <version>2.5.3</version>
215 <groupId>io.fd.honeycomb.common</groupId>
216 <artifactId>minimal-assembly-descriptor</artifactId>
217 <version>1.16.9</version>
222 <id>create-archive</id>
223 <phase>package</phase>
229 <descriptorRef>honeycomb-minimal</descriptorRef>
237 <groupId>org.codehaus.mojo</groupId>
238 <artifactId>exec-maven-plugin</artifactId>