pom.xml revision 2ea62795
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.18.07-SNAPSHOT</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.18.07-SNAPSHOT</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.gmaven</groupId>
91                    <artifactId>groovy-maven-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                                <source>
101                                    io.fd.honeycomb.common.scripts.StartupScriptGenerator.generate(project, properties, log)
102                                </source>
103                            </configuration>
104                        </execution>
105                        <execution>
106                            <id>distribution-module-assembly</id>
107                            <!-- phase changed from package to earlier phase to generate module descriptor before distribution jar is created,
108                             to include descriptor in the jar,to be accessible to children distributions-->
109                            <phase>prepare-package</phase>
110                            <goals>
111                                <goal>execute</goal>
112                            </goals>
113                            <configuration>
114                                <source>
115                                    io.fd.honeycomb.common.scripts.ModulesListGenerator.generate(project, properties, log)
116                                </source>
117                            </configuration>
118                        </execution>
119                        <execution>
120                            <id>generate-module-to-yang-index</id>
121                            <phase>prepare-package</phase>
122                            <goals>
123                                <goal>execute</goal>
124                            </goals>
125                            <configuration>
126                                <source>
127                                    io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log)
128                                </source>
129                            </configuration>
130                        </execution>
131                    </executions>
132                    <dependencies>
133                        <dependency>
134                            <groupId>io.fd.honeycomb.common</groupId>
135                            <artifactId>common-scripts</artifactId>
136                            <version>1.18.07-SNAPSHOT</version>
137                        </dependency>
138                    </dependencies>
139                </plugin>
140
141                <!-- Build archives -->
142                <plugin>
143                    <artifactId>maven-assembly-plugin</artifactId>
144                    <version>2.5.3</version>
145                    <dependencies>
146                        <dependency>
147                            <groupId>io.fd.honeycomb.common</groupId>
148                            <artifactId>minimal-assembly-descriptor</artifactId>
149                            <version>1.18.07-SNAPSHOT</version>
150                        </dependency>
151                    </dependencies>
152                    <executions>
153                        <execution>
154                            <id>create-archive</id>
155                            <phase>package</phase>
156                            <goals>
157                                <goal>single</goal>
158                            </goals>
159                            <configuration>
160                                <descriptorRefs>
161                                    <descriptorRef>honeycomb-minimal</descriptorRef>
162                                </descriptorRefs>
163                            </configuration>
164                        </execution>
165                    </executions>
166                </plugin>
167
168                <plugin>
169                    <artifactId>maven-surefire-plugin</artifactId>
170                    <configuration>
171                        <!--http://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec-->
172                        <argLine>${argLine} -Djava.security.egd=file:${random.seed.file}</argLine>
173                    </configuration>
174                </plugin>
175            </plugins>
176        </pluginManagement>
177        <plugins>
178            <plugin>
179                <groupId>org.codehaus.gmaven</groupId>
180                <artifactId>groovy-maven-plugin</artifactId>
181            </plugin>
182            <plugin>
183                <groupId>org.apache.maven.plugins</groupId>
184                <artifactId>maven-jar-plugin</artifactId>
185            </plugin>
186            <plugin>
187                <groupId>org.apache.maven.plugins</groupId>
188                <artifactId>maven-dependency-plugin</artifactId>
189            </plugin>
190            <plugin>
191                <artifactId>maven-assembly-plugin</artifactId>
192            </plugin>
193        </plugins>
194    </build>
195</project>
196