10f5925e9SMaros Marsalek<?xml version="1.0" encoding="UTF-8"?>
20f5925e9SMaros Marsalek<!--
30f5925e9SMaros Marsalek  ~ Copyright (c) 2016 Cisco and/or its affiliates.
40f5925e9SMaros Marsalek  ~
50f5925e9SMaros Marsalek  ~ Licensed under the Apache License, Version 2.0 (the "License");
60f5925e9SMaros Marsalek  ~ you may not use this file except in compliance with the License.
70f5925e9SMaros Marsalek  ~ You may obtain a copy of the License at:
80f5925e9SMaros Marsalek  ~
90f5925e9SMaros Marsalek  ~     http://www.apache.org/licenses/LICENSE-2.0
100f5925e9SMaros Marsalek  ~
110f5925e9SMaros Marsalek  ~ Unless required by applicable law or agreed to in writing, software
120f5925e9SMaros Marsalek  ~ distributed under the License is distributed on an "AS IS" BASIS,
130f5925e9SMaros Marsalek  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
140f5925e9SMaros Marsalek  ~ See the License for the specific language governing permissions and
150f5925e9SMaros Marsalek  ~ limitations under the License.
160f5925e9SMaros Marsalek  -->
170f5925e9SMaros Marsalek<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
180f5925e9SMaros Marsalek         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
190f5925e9SMaros Marsalek
20413d05ccSMaros Marsalek    <parent>
215cfbc703SMaros Marsalek        <groupId>io.fd.honeycomb.common</groupId>
225cfbc703SMaros Marsalek        <artifactId>impl-parent</artifactId>
23b52cda3fSMichal Cmarada        <version>1.19.08-SNAPSHOT</version>
245cfbc703SMaros Marsalek        <relativePath>../impl-parent</relativePath>
25413d05ccSMaros Marsalek    </parent>
26413d05ccSMaros Marsalek
271326e9faSMaros Marsalek    <modelVersion>4.0.0</modelVersion>
281326e9faSMaros Marsalek    <artifactId>minimal-distribution-parent</artifactId>
29bc335de4SMaros Marsalek    <name>${project.artifactId}</name>
30b52cda3fSMichal Cmarada    <version>1.19.08-SNAPSHOT</version>
311326e9faSMaros Marsalek    <packaging>pom</packaging>
321326e9faSMaros Marsalek
330f5925e9SMaros Marsalek    <properties>
34a0fc5d80SJan Srnicek        <exec.parameters>-Xms32m -Xmn90m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
35cefd2555SMaros Marsalek        <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>
365cfbc703SMaros Marsalek
37bb972b57SMaros Marsalek        <!-- Use /dev/urandom instead of /dev/random during tests to speed up execution
38bb972b57SMaros Marsalek            http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom
39bb972b57SMaros Marsalek        -->
40bb972b57SMaros Marsalek        <random.seed.file>/dev/./urandom</random.seed.file>
410f5925e9SMaros Marsalek    </properties>
420f5925e9SMaros Marsalek
430f5925e9SMaros Marsalek    <!-- Generate executable shell script -->
440f5925e9SMaros Marsalek    <build>
450f5925e9SMaros Marsalek        <pluginManagement>
460f5925e9SMaros Marsalek            <plugins>
470f5925e9SMaros Marsalek                <plugin>
480f5925e9SMaros Marsalek                    <groupId>org.apache.maven.plugins</groupId>
490f5925e9SMaros Marsalek                    <artifactId>maven-jar-plugin</artifactId>
500f5925e9SMaros Marsalek                    <version>2.6</version>
510f5925e9SMaros Marsalek                    <configuration>
520f5925e9SMaros Marsalek                        <archive>
530f5925e9SMaros Marsalek                            <manifest>
540f5925e9SMaros Marsalek                                <mainClass>${main.class}</mainClass>
550f5925e9SMaros Marsalek                                <addClasspath>true</addClasspath>
560f5925e9SMaros Marsalek                                <classpathPrefix>lib/</classpathPrefix>
57d022ca8dSMaros Marsalek                                <useUniqueVersions>false</useUniqueVersions>
58d022ca8dSMaros Marsalek                                <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
590f5925e9SMaros Marsalek                            </manifest>
600f5925e9SMaros Marsalek                            <manifestEntries>
6162dd4d32SJan Srnicek                                <Class-Path>config/ cert/ modules/ yang-mapping/</Class-Path>
620f5925e9SMaros Marsalek                            </manifestEntries>
630f5925e9SMaros Marsalek                        </archive>
640f5925e9SMaros Marsalek                    </configuration>
650f5925e9SMaros Marsalek                </plugin>
660f5925e9SMaros Marsalek
670f5925e9SMaros Marsalek                <plugin>
680f5925e9SMaros Marsalek                    <groupId>org.apache.maven.plugins</groupId>
690f5925e9SMaros Marsalek                    <artifactId>maven-dependency-plugin</artifactId>
700f5925e9SMaros Marsalek                    <version>2.10</version>
710f5925e9SMaros Marsalek                    <executions>
7262dd4d32SJan Srnicek                        <!-- Dependencies are copied by parent project -->
730f5925e9SMaros Marsalek                        <execution>
740f5925e9SMaros Marsalek                            <id>unpack-configuration</id>
750f5925e9SMaros Marsalek                            <phase>prepare-package</phase>
760f5925e9SMaros Marsalek                            <goals>
770f5925e9SMaros Marsalek                                <goal>unpack-dependencies</goal>
780f5925e9SMaros Marsalek                            </goals>
790f5925e9SMaros Marsalek                            <configuration>
800f5925e9SMaros Marsalek                                <includes>**/honeycomb-minimal-resources/</includes>
810f5925e9SMaros Marsalek                                <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
820f5925e9SMaros Marsalek                            </configuration>
830f5925e9SMaros Marsalek                        </execution>
840f5925e9SMaros Marsalek                    </executions>
850f5925e9SMaros Marsalek                </plugin>
860f5925e9SMaros Marsalek
870f5925e9SMaros Marsalek                <!-- Generate shell script -->
886c3f614eSJan Srnicek                <!-- Extract modules started by distribution -->
890f5925e9SMaros Marsalek                <plugin>
90a7a8f982SMichal Cmarada                    <groupId>org.codehaus.gmavenplus</groupId>
91a7a8f982SMichal Cmarada                    <artifactId>gmavenplus-plugin</artifactId>
920f5925e9SMaros Marsalek                    <executions>
930f5925e9SMaros Marsalek                        <execution>
946c3f614eSJan Srnicek                            <id>start-scripts-generation</id>
950f5925e9SMaros Marsalek                            <phase>package</phase>
960f5925e9SMaros Marsalek                            <goals>
970f5925e9SMaros Marsalek                                <goal>execute</goal>
980f5925e9SMaros Marsalek                            </goals>
990f5925e9SMaros Marsalek                            <configuration>
100a7a8f982SMichal Cmarada                                <scripts>
101a7a8f982SMichal Cmarada                                    <script>
102a7a8f982SMichal Cmarada                                        <![CDATA[
103a7a8f982SMichal Cmarada                                            import io.fd.honeycomb.common.scripts.StartupScriptGenerator
104a7a8f982SMichal Cmarada                                            StartupScriptGenerator.generate(project, properties, log)
105a7a8f982SMichal Cmarada                                        ]]>
106a7a8f982SMichal Cmarada                                    </script>
107a7a8f982SMichal Cmarada                                </scripts>
1080f5925e9SMaros Marsalek                            </configuration>
1090f5925e9SMaros Marsalek                        </execution>
1106c3f614eSJan Srnicek                        <execution>
1116c3f614eSJan Srnicek                            <id>distribution-module-assembly</id>
1126c3f614eSJan Srnicek                            <!-- phase changed from package to earlier phase to generate module descriptor before distribution jar is created,
1136c3f614eSJan Srnicek                             to include descriptor in the jar,to be accessible to children distributions-->
1146c3f614eSJan Srnicek                            <phase>prepare-package</phase>
1156c3f614eSJan Srnicek                            <goals>
1166c3f614eSJan Srnicek                                <goal>execute</goal>
1176c3f614eSJan Srnicek                            </goals>
1186c3f614eSJan Srnicek                            <configuration>
119a7a8f982SMichal Cmarada                                <scripts>
120a7a8f982SMichal Cmarada                                    <script>
121a7a8f982SMichal Cmarada                                        <![CDATA[
122a7a8f982SMichal Cmarada                                            import io.fd.honeycomb.common.scripts.ModulesListGenerator
123a7a8f982SMichal Cmarada                                            ModulesListGenerator.generate(project, log)
124a7a8f982SMichal Cmarada                                        ]]>
125a7a8f982SMichal Cmarada                                    </script>
126a7a8f982SMichal Cmarada                                </scripts>
1276c3f614eSJan Srnicek                            </configuration>
1286c3f614eSJan Srnicek                        </execution>
12962dd4d32SJan Srnicek                        <execution>
13062dd4d32SJan Srnicek                            <id>generate-module-to-yang-index</id>
13162dd4d32SJan Srnicek                            <phase>prepare-package</phase>
13262dd4d32SJan Srnicek                            <goals>
13362dd4d32SJan Srnicek                                <goal>execute</goal>
13462dd4d32SJan Srnicek                            </goals>
13562dd4d32SJan Srnicek                            <configuration>
136a7a8f982SMichal Cmarada                                <scripts>
137a7a8f982SMichal Cmarada                                    <script>
138a7a8f982SMichal Cmarada                                        <![CDATA[
139a7a8f982SMichal Cmarada                                            import io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator
140a7a8f982SMichal Cmarada                                            ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log)
141a7a8f982SMichal Cmarada                                        ]]>
142a7a8f982SMichal Cmarada                                    </script>
143a7a8f982SMichal Cmarada                                </scripts>
14462dd4d32SJan Srnicek                            </configuration>
14562dd4d32SJan Srnicek                        </execution>
1460f5925e9SMaros Marsalek                    </executions>
1477236617fSMaros Marsalek                    <dependencies>
1487236617fSMaros Marsalek                        <dependency>
1497236617fSMaros Marsalek                            <groupId>io.fd.honeycomb.common</groupId>
1507236617fSMaros Marsalek                            <artifactId>common-scripts</artifactId>
151b52cda3fSMichal Cmarada                            <version>1.19.08-SNAPSHOT</version>
1527236617fSMaros Marsalek                        </dependency>
1537236617fSMaros Marsalek                    </dependencies>
1540f5925e9SMaros Marsalek                </plugin>
1550f5925e9SMaros Marsalek
1560f5925e9SMaros Marsalek                <!-- Build archives -->
1570f5925e9SMaros Marsalek                <plugin>
1580f5925e9SMaros Marsalek                    <artifactId>maven-assembly-plugin</artifactId>
1590f5925e9SMaros Marsalek                    <version>2.5.3</version>
1600f5925e9SMaros Marsalek                    <dependencies>
1610f5925e9SMaros Marsalek                        <dependency>
1620f5925e9SMaros Marsalek                            <groupId>io.fd.honeycomb.common</groupId>
1630f5925e9SMaros Marsalek                            <artifactId>minimal-assembly-descriptor</artifactId>
164b52cda3fSMichal Cmarada                            <version>1.19.08-SNAPSHOT</version>
1650f5925e9SMaros Marsalek                        </dependency>
1660f5925e9SMaros Marsalek                    </dependencies>
1670f5925e9SMaros Marsalek                    <executions>
1680f5925e9SMaros Marsalek                        <execution>
1690f5925e9SMaros Marsalek                            <id>create-archive</id>
1700f5925e9SMaros Marsalek                            <phase>package</phase>
1710f5925e9SMaros Marsalek                            <goals>
1720f5925e9SMaros Marsalek                                <goal>single</goal>
1730f5925e9SMaros Marsalek                            </goals>
1740f5925e9SMaros Marsalek                            <configuration>
1750f5925e9SMaros Marsalek                                <descriptorRefs>
1760f5925e9SMaros Marsalek                                    <descriptorRef>honeycomb-minimal</descriptorRef>
1770f5925e9SMaros Marsalek                                </descriptorRefs>
1780f5925e9SMaros Marsalek                            </configuration>
1790f5925e9SMaros Marsalek                        </execution>
1800f5925e9SMaros Marsalek                    </executions>
1810f5925e9SMaros Marsalek                </plugin>
182bb972b57SMaros Marsalek
183bb972b57SMaros Marsalek                <plugin>
184bb972b57SMaros Marsalek                    <artifactId>maven-surefire-plugin</artifactId>
185a7a8f982SMichal Cmarada                    <version>2.22.0</version>
186bb972b57SMaros Marsalek                    <configuration>
187413d05ccSMaros Marsalek                        <!--http://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec-->
188a7a8f982SMichal Cmarada                        <argLine>${argLine} -Djava.security.egd=file:${random.seed.file} --illegal-access=permit</argLine>
189bb972b57SMaros Marsalek                    </configuration>
190bb972b57SMaros Marsalek                </plugin>
1910f5925e9SMaros Marsalek            </plugins>
1920f5925e9SMaros Marsalek        </pluginManagement>
193413d05ccSMaros Marsalek        <plugins>
194413d05ccSMaros Marsalek            <plugin>
195a7a8f982SMichal Cmarada                <groupId>org.codehaus.gmavenplus</groupId>
196a7a8f982SMichal Cmarada                <artifactId>gmavenplus-plugin</artifactId>
197413d05ccSMaros Marsalek            </plugin>
198413d05ccSMaros Marsalek            <plugin>
199413d05ccSMaros Marsalek                <groupId>org.apache.maven.plugins</groupId>
2005cfbc703SMaros Marsalek                <artifactId>maven-jar-plugin</artifactId>
201413d05ccSMaros Marsalek            </plugin>
202413d05ccSMaros Marsalek            <plugin>
203413d05ccSMaros Marsalek                <groupId>org.apache.maven.plugins</groupId>
2045cfbc703SMaros Marsalek                <artifactId>maven-dependency-plugin</artifactId>
2055cfbc703SMaros Marsalek            </plugin>
2065cfbc703SMaros Marsalek            <plugin>
2075cfbc703SMaros Marsalek                <artifactId>maven-assembly-plugin</artifactId>
208413d05ccSMaros Marsalek            </plugin>
209413d05ccSMaros Marsalek        </plugins>
2100f5925e9SMaros Marsalek    </build>
2110f5925e9SMaros Marsalek</project>
212