Bump honeycomb version to 1.17.10-SNAPSHOT
[honeycomb.git] / common / minimal-distribution-parent / pom.xml
index b003231..640ca17 100644 (file)
     <parent>
         <groupId>io.fd.honeycomb.common</groupId>
         <artifactId>impl-parent</artifactId>
-        <version>1.16.12-SNAPSHOT</version>
+        <version>1.17.10-SNAPSHOT</version>
         <relativePath>../impl-parent</relativePath>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
     <artifactId>minimal-distribution-parent</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.16.12-SNAPSHOT</version>
+    <version>1.17.10-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
-        <start.script.template>
-#!/bin/sh -
-STATUS=100
-
-while [ $STATUS -eq 100 ]
-do
-  %s
-  STATUS=$?
-  echo "Honeycomb exited with status: $STATUS"
-  if [ $STATUS -eq 100 ]
-  then
-    echo "Restarting..."
-  fi
-done
-        </start.script.template>
         <exec.parameters>-Xms32m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
         <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>
-        <debug.parameters>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debug.parameters>
 
-        <!-- Jersey versions to run RESTCONF-->
-        <jersey.version>1.19.1</jersey.version>
-        <jetty.version>9.3.11.v20160721</jetty.version>
-        <servlet.version>3.1.0</servlet.version>
-        <!-- Used by mdsal as provided/runtime dependency-->
-        <osgi.core.version>5.0.0</osgi.core.version>
         <!-- Use /dev/urandom instead of /dev/random during tests to speed up execution
             http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom
         -->
         <random.seed.file>/dev/./urandom</random.seed.file>
     </properties>
 
-    <dependencyManagement>
-        <dependencies>
-            <!-- Jersey + Jetty for RESTCONF -->
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-server</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>javax.servlet</groupId>
-                <artifactId>javax.servlet-api</artifactId>
-                <version>${servlet.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-webapp</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-servlets</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.sun.jersey</groupId>
-                <artifactId>jersey-server</artifactId>
-                <version>${jersey.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.sun.jersey</groupId>
-                <artifactId>jersey-core</artifactId>
-                <version>${jersey.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>com.sun.jersey</groupId>
-                <artifactId>jersey-servlet</artifactId>
-                <version>${jersey.version}</version>
-            </dependency>
-            <!-- OSGI Even tough not running in OSGI, dependency needs to be here since some deprecated MD-SAL APIs rely on osgi core -->
-            <dependency>
-                <groupId>org.osgi</groupId>
-                <artifactId>org.osgi.core</artifactId>
-                <version>${osgi.core.version}</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <!-- Generate executable shell script -->
     <build>
         <pluginManagement>
@@ -127,31 +58,18 @@ done
                                 <classpathMavenRepositoryLayout>true</classpathMavenRepositoryLayout>
                             </manifest>
                             <manifestEntries>
-                                <Class-Path>config/ cert/</Class-Path>
+                                <Class-Path>config/ cert/ modules/ yang-mapping/</Class-Path>
                             </manifestEntries>
                         </archive>
                     </configuration>
                 </plugin>
 
-                <!-- Copy all dependencies -->
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-dependency-plugin</artifactId>
                     <version>2.10</version>
                     <executions>
-                        <execution>
-                            <id>copy-dependencies</id>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>copy-dependencies</goal>
-                            </goals>
-                            <configuration>
-                                <outputDirectory>${project.build.directory}/lib</outputDirectory>
-                                <useBaseVersion>true</useBaseVersion>
-                                <useRepositoryLayout>true</useRepositoryLayout>
-                                <excludeArtifactIds>yang-jmx-generator</excludeArtifactIds>
-                            </configuration>
-                        </execution>
+                        <!-- Dependencies are copied by parent project -->
                         <execution>
                             <id>unpack-configuration</id>
                             <phase>prepare-package</phase>
@@ -167,50 +85,57 @@ done
                 </plugin>
 
                 <!-- Generate shell script -->
+                <!-- Extract modules started by distribution -->
                 <plugin>
                     <groupId>org.codehaus.gmaven</groupId>
                     <artifactId>groovy-maven-plugin</artifactId>
                     <executions>
                         <execution>
+                            <id>start-scripts-generation</id>
                             <phase>package</phase>
                             <goals>
                                 <goal>execute</goal>
                             </goals>
                             <configuration>
-                                <!-- TODO HONEYCOMB-157 Make scripts more robust -->
                                 <source>
-                                    import java.nio.file.Paths
-
-                                    log.info "Generating shell exec script"
-                                    def scriptTemplate = properties.getOrDefault("start.script.template", "")
-                                    def args = properties.getOrDefault("exec.parameters", "")
-                                    log.debug "Additional shell exec script properties: ${args}"
-                                    def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
-                                    def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
-                                    scriptParent.toFile().mkdirs()
-                                    def scriptContent = "java " + javaArgs
-                                    log.info "Generating shell exec script as ${scriptContent}"
-                                    def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
-                                    log.info "Writing shell exec script to ${scriptPath}"
-                                    scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
-                                    scriptPath.toFile().setExecutable(true)
-
-                                    scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
-                                    log.info "Writing shell exec script to ${scriptPath}"
-                                    scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
-                                    scriptPath.toFile().setExecutable(true)
-
-                                    def debug_args = properties.getOrDefault("debug.parameters", "")
-                                    def debugScriptContent = "java" + " ${debug_args} " + javaArgs
-                                    log.info "Generating shell debug script as ${debugScriptContent}"
-                                    scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
-                                    log.info "Writing shell debug script to ${scriptPath}"
-                                    scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
-                                    scriptPath.toFile().setExecutable(true)
+                                    io.fd.honeycomb.common.scripts.StartupScriptGenerator.generate(project, properties, log)
+                                </source>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>distribution-module-assembly</id>
+                            <!-- phase changed from package to earlier phase to generate module descriptor before distribution jar is created,
+                             to include descriptor in the jar,to be accessible to children distributions-->
+                            <phase>prepare-package</phase>
+                            <goals>
+                                <goal>execute</goal>
+                            </goals>
+                            <configuration>
+                                <source>
+                                    io.fd.honeycomb.common.scripts.ModulesListGenerator.generate(project, properties, log)
+                                </source>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>generate-module-to-yang-index</id>
+                            <phase>prepare-package</phase>
+                            <goals>
+                                <goal>execute</goal>
+                            </goals>
+                            <configuration>
+                                <source>
+                                    io.fd.honeycomb.common.scripts.ModuleYangIndexGenerator.pairDistributionModulesWithYangModules(project, log)
                                 </source>
                             </configuration>
                         </execution>
                     </executions>
+                    <dependencies>
+                        <dependency>
+                            <groupId>io.fd.honeycomb.common</groupId>
+                            <artifactId>common-scripts</artifactId>
+                            <version>1.17.10-SNAPSHOT</version>
+                        </dependency>
+                    </dependencies>
                 </plugin>
 
                 <!-- Build archives -->
@@ -221,7 +146,7 @@ done
                         <dependency>
                             <groupId>io.fd.honeycomb.common</groupId>
                             <artifactId>minimal-assembly-descriptor</artifactId>
-                            <version>1.16.12-SNAPSHOT</version>
+                            <version>1.17.10-SNAPSHOT</version>
                         </dependency>
                     </dependencies>
                     <executions>