1e2d1c0306bac3f2ccb95962e5f1fa3ebf7497de
[demo.git] / vnfs / vLBMS / apis / vlb-vnf-onap-distribution / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3
4   <parent>
5     <groupId>io.fd.honeycomb.common</groupId>
6     <artifactId>minimal-distribution-parent</artifactId>
7     <version>1.17.07</version>
8   </parent>
9
10   <modelVersion>4.0.0</modelVersion>
11   <groupId>org.onap.demo.vnf.vlb</groupId>
12   <artifactId>vlb-vnf-onap-distribution</artifactId>
13   <version>1.2.0</version>
14
15   <properties>
16     <nexusproxy>http://nexus.fd.io/content</nexusproxy>
17     <start.script.template>
18 #!/bin/sh -
19 %s
20     </start.script.template>
21
22     <exec.parameters>-Xms128m -Xmx128m</exec.parameters>
23     <main.class>io.fd.honeycomb.infra.distro.Main</main.class>
24     <interfaces.mapping.version>1.17.07</interfaces.mapping.version>
25     <honeycomb.min.distro.version>1.17.07</honeycomb.min.distro.version>
26     <!--
27        Defines list of specific modules provided by the distribution
28        (adds them to base modules like NetconfModule and RestconfModule).
29
30        Module configuration is placed in 'modules' subdir of the target distro folder.
31        Modules can be disabled by commenting them out in the pom.xml
32        or modules configuration file.
33      -->
34     <distribution.modules>
35       org.onap.vnf.vlb.Module
36       org.onap.vnf.health.Module
37     </distribution.modules>
38   </properties>
39
40   <build>
41     <plugins>
42       <plugin>
43         <groupId>org.apache.maven.plugins</groupId>
44         <artifactId>maven-compiler-plugin</artifactId>
45         <version>3.3</version>
46         <configuration>
47           <!-- Use google's error-prone static analysis-->
48           <compilerId>javac-with-errorprone</compilerId>
49           <forceJavacCompilerUse>true</forceJavacCompilerUse>
50           <showWarnings>true</showWarnings>
51           <source>1.8</source>
52           <target>1.8</target>
53         </configuration>
54         <dependencies>
55           <dependency>
56             <groupId>org.codehaus.plexus</groupId>
57             <artifactId>plexus-compiler-javac-errorprone</artifactId>
58             <version>2.5</version>
59           </dependency>
60           <!-- override plexus-compiler-javac-errorprone's dependency on
61                Error Prone with the latest version -->
62           <dependency>
63             <groupId>com.google.errorprone</groupId>
64             <artifactId>error_prone_core</artifactId>
65             <version>2.0.9</version>
66           </dependency>
67         </dependencies>
68       </plugin>
69       <plugin>
70         <groupId>org.apache.maven.plugins</groupId>
71         <artifactId>maven-jar-plugin</artifactId>
72         <configuration>
73           <archive>
74             <manifest>
75               <mainClass>${main.class}</mainClass>
76               <addClasspath>true</addClasspath>
77               <classpathPrefix>lib/</classpathPrefix>
78               <useUniqueVersions>false</useUniqueVersions>
79               <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
80             </manifest>
81             <manifestEntries>
82               <Class-Path>config/ cert/ modules/ yang-mapping/</Class-Path>
83             </manifestEntries>
84           </archive>
85         </configuration>
86       </plugin>
87       <plugin>
88         <groupId>org.apache.maven.plugins</groupId>
89         <artifactId>maven-dependency-plugin</artifactId>
90         <executions>
91           <execution>
92             <id>copy-dependencies</id>
93             <phase>package</phase>
94             <goals>
95               <goal>copy-dependencies</goal>
96             </goals>
97             <configuration>
98               <outputDirectory>${project.build.directory}/lib</outputDirectory>
99               <useBaseVersion>true</useBaseVersion>
100               <useRepositoryLayout>true</useRepositoryLayout>
101               <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
102             </configuration>
103            </execution>
104            <execution>
105              <id>unpack-configuration</id>
106              <phase>prepare-package</phase>
107              <goals>
108                <goal>unpack-dependencies</goal>
109              </goals>
110              <configuration>
111                <includes>**/honeycomb-minimal-resources/</includes>
112                <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
113              </configuration>
114            </execution>
115          </executions>
116       </plugin>
117
118       <!-- Generate shell script -->
119       <plugin>
120         <groupId>org.codehaus.gmaven</groupId>
121         <artifactId>groovy-maven-plugin</artifactId>
122         <version>2.0</version>
123         <executions>
124           <execution>
125             <phase>package</phase>
126             <goals>
127               <goal>execute</goal>
128             </goals>
129             <configuration>
130               <source>
131                 import java.nio.file.Paths
132
133                 log.info "Generating shell exec script"
134                 def scriptTemplate = properties.getOrDefault("start.script.template", "")
135                 def args = properties.getOrDefault("exec.parameters", "")
136                 log.debug "Additional shell exec script properties: ${args}"
137                 def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
138                 def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
139                 scriptParent.toFile().mkdirs()
140                 def scriptContent = "java " + javaArgs
141                 log.info "Generating shell exec script as ${scriptContent}"
142                 def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
143                 log.info "Writing shell exec script to ${scriptPath}"
144                 scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
145                 scriptPath.toFile().setExecutable(true)
146
147                 scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
148                 log.info "Writing shell exec script to ${scriptPath}"
149                 scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
150                 scriptPath.toFile().setExecutable(true)
151
152                 def debug_args = properties.getOrDefault("debug.parameters", "")
153                 def debugScriptContent = "java" + " ${debug_args} " + javaArgs
154                 log.info "Generating shell debug script as ${debugScriptContent}"
155                 scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
156                 log.info "Writing shell debug script to ${scriptPath}"
157                 scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
158                 scriptPath.toFile().setExecutable(true)
159               </source>
160             </configuration>
161           </execution>
162         </executions>
163       </plugin>
164       <plugin>
165         <artifactId>maven-assembly-plugin</artifactId>
166         <dependencies>
167           <dependency>
168             <groupId>io.fd.honeycomb.common</groupId>
169             <artifactId>minimal-assembly-descriptor</artifactId>
170             <version>1.17.07</version>
171           </dependency>
172         </dependencies>
173         <executions>
174           <execution>
175             <id>create-archive</id>
176             <phase>package</phase>
177             <goals>
178               <goal>single</goal>
179             </goals>
180             <configuration>
181               <descriptorRefs>
182                 <descriptorRef>honeycomb-minimal</descriptorRef>
183               </descriptorRefs>
184             </configuration>
185           </execution>
186         </executions>
187       </plugin>
188       <plugin>
189         <groupId>org.apache.maven.plugins</groupId>
190         <artifactId>maven-deploy-plugin</artifactId>
191         <configuration>
192           <skip>false</skip>
193         </configuration>
194       </plugin>
195       <plugin>
196         <groupId>org.apache.maven.plugins</groupId>
197         <artifactId>maven-install-plugin</artifactId>
198         <configuration>
199           <skip>false</skip>
200         </configuration>
201       </plugin>
202       <plugin>
203         <groupId>org.codehaus.mojo</groupId>
204         <artifactId>exec-maven-plugin</artifactId>
205         <executions>
206           <execution>
207             <phase>none</phase>
208           </execution>
209         </executions>
210         <configuration>
211           <skip>true</skip>
212         </configuration>
213       </plugin>
214       <plugin>
215         <artifactId>maven-checkstyle-plugin</artifactId>
216         <configuration>
217           <skip>true</skip>
218         </configuration>
219       </plugin>
220     </plugins>
221   </build>
222
223   <dependencies>
224     <!-- Dependency on sample plugin -->
225     <dependency>
226       <groupId>org.onap.demo.vnf.vlb</groupId>
227       <artifactId>vlb-business-vnf-onap-plugin-impl</artifactId>
228       <version>${interfaces.mapping.version}</version>
229     </dependency>
230     <dependency>
231       <groupId>org.onap.demo.vnf.health</groupId>
232       <artifactId>health-vnf-onap-plugin-impl</artifactId>
233       <version>${interfaces.mapping.version}</version>
234     </dependency>
235     <!-- Dependency on distribution base -->
236     <dependency>
237       <groupId>io.fd.honeycomb</groupId>
238       <artifactId>minimal-distribution</artifactId>
239       <version>${honeycomb.min.distro.version}</version>
240     </dependency>
241   </dependencies>
242 </project>