Honeycomb 1.19.04-RC2
[honeycomb.git] / common / minimal-distribution-parent / 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 <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">
19
20     <parent>
21         <groupId>io.fd.honeycomb.common</groupId>
22         <artifactId>impl-parent</artifactId>
23         <version>1.19.04-RC2</version>
24         <relativePath>../impl-parent</relativePath>
25     </parent>
26
27     <modelVersion>4.0.0</modelVersion>
28     <artifactId>minimal-distribution-parent</artifactId>
29     <name>${project.artifactId}</name>
30     <version>1.19.04-RC2</version>
31     <packaging>pom</packaging>
32
33     <properties>
34         <exec.parameters>-Xms32m -Xmn90m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
35         <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>
36
37         <!-- Use /dev/urandom instead of /dev/random during tests to speed up execution
38             http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom
39         -->
40         <random.seed.file>/dev/./urandom</random.seed.file>
41     </properties>
42
43     <!-- Generate executable shell script -->
44     <build>
45         <pluginManagement>
46             <plugins>
47                 <plugin>
48                     <groupId>org.apache.maven.plugins</groupId>
49                     <artifactId>maven-jar-plugin</artifactId>
50                     <version>2.6</version>
51                     <configuration>
52                         <archive>
53                             <manifest>
54                                 <mainClass>${main.class}</mainClass>
55                                 <addClasspath>true</addClasspath>
56                                 <classpathPrefix>lib/</classpathPrefix>
57                                 <useUniqueVersions>false</useUniqueVersions>
58                                 <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
59                             </manifest>
60                             <manifestEntries>
61                                 <Class-Path>config/ cert/ modules/ yang-mapping/</Class-Path>
62                             </manifestEntries>
63                         </archive>
64                     </configuration>
65                 </plugin>
66
67                 <plugin>
68                     <groupId>org.apache.maven.plugins</groupId>
69                     <artifactId>maven-dependency-plugin</artifactId>
70                     <version>2.10</version>
71                     <executions>
72                         <!-- Dependencies are copied by parent project -->
73                         <execution>
74                             <id>unpack-configuration</id>
75                             <phase>prepare-package</phase>
76                             <goals>
77                                 <goal>unpack-dependencies</goal>
78                             </goals>
79                             <configuration>
80                                 <includes>**/honeycomb-minimal-resources/</includes>
81                                 <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
82                             </configuration>
83                         </execution>
84                     </executions>
85                 </plugin>
86
87                 <!-- Generate shell script -->
88                 <!-- Extract modules started by distribution -->
89                 <plugin>
90                     <groupId>org.codehaus.gmavenplus</groupId>
91                     <artifactId>gmavenplus-plugin</artifactId>
92                     <executions>
93                         <execution>
94                             <id>start-scripts-generation</id>
95                             <phase>package</phase>
96                             <goals>
97                                 <goal>execute</goal>
98                             </goals>
99                             <configuration>
100                                 <scripts>
101                                     <script>
102                                         <![CDATA[
103                                             import io.fd.honeycomb.common.scripts.StartupScriptGenerator
104                                             StartupScriptGenerator.generate(project, properties, log)
105                                         ]]>
106                                     </script>
107                                 </scripts>
108                             </configuration>
109                         </execution>
110                         <execution>
111                             <id>distribution-module-assembly</id>
112                             <!-- phase changed from package to earlier phase to generate module descriptor before distribution jar is created,
113                              to include descriptor in the jar,to be accessible to children distributions-->
114                             <phase>prepare-package</phase>
115                             <goals>
116                                 <goal>execute</goal>
117                             </goals>
118                             <configuration>
119                                 <scripts>
120                                     <script>
121                                         <![CDATA[
122                                             import io.fd.honeycomb.common.scripts.ModulesListGenerator
123                                             ModulesListGenerator.generate(project, log)
124                                         ]]>
125                                     </script>
126                                 </scripts>
127                             </configuration>
128                         </execution>
129                         <execution>
130                             <id>generate-module-to-yang-index</id>
131                             <phase>prepare-package</phase>
132                             <goals>
133                                 <goal>execute</goal>
134                             </goals>
135                             <configuration>
136                                 <scripts>
137                                     <script>
138                                         <![CDATA[
139                                             import io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator
140                                             ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log)
141                                         ]]>
142                                     </script>
143                                 </scripts>
144                             </configuration>
145                         </execution>
146                     </executions>
147                     <dependencies>
148                         <dependency>
149                             <groupId>io.fd.honeycomb.common</groupId>
150                             <artifactId>common-scripts</artifactId>
151                             <version>1.19.04-RC2</version>
152                         </dependency>
153                     </dependencies>
154                 </plugin>
155
156                 <!-- Build archives -->
157                 <plugin>
158                     <artifactId>maven-assembly-plugin</artifactId>
159                     <version>2.5.3</version>
160                     <dependencies>
161                         <dependency>
162                             <groupId>io.fd.honeycomb.common</groupId>
163                             <artifactId>minimal-assembly-descriptor</artifactId>
164                             <version>1.19.04-RC2</version>
165                         </dependency>
166                     </dependencies>
167                     <executions>
168                         <execution>
169                             <id>create-archive</id>
170                             <phase>package</phase>
171                             <goals>
172                                 <goal>single</goal>
173                             </goals>
174                             <configuration>
175                                 <descriptorRefs>
176                                     <descriptorRef>honeycomb-minimal</descriptorRef>
177                                 </descriptorRefs>
178                             </configuration>
179                         </execution>
180                     </executions>
181                 </plugin>
182
183                 <plugin>
184                     <artifactId>maven-surefire-plugin</artifactId>
185                     <version>2.22.0</version>
186                     <configuration>
187                         <!--http://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec-->
188                         <argLine>${argLine} -Djava.security.egd=file:${random.seed.file} --illegal-access=permit</argLine>
189                     </configuration>
190                 </plugin>
191             </plugins>
192         </pluginManagement>
193         <plugins>
194             <plugin>
195                 <groupId>org.codehaus.gmavenplus</groupId>
196                 <artifactId>gmavenplus-plugin</artifactId>
197             </plugin>
198             <plugin>
199                 <groupId>org.apache.maven.plugins</groupId>
200                 <artifactId>maven-jar-plugin</artifactId>
201             </plugin>
202             <plugin>
203                 <groupId>org.apache.maven.plugins</groupId>
204                 <artifactId>maven-dependency-plugin</artifactId>
205             </plugin>
206             <plugin>
207                 <artifactId>maven-assembly-plugin</artifactId>
208             </plugin>
209         </plugins>
210     </build>
211 </project>