You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2017/09/28 18:22:18 UTC

nifi-registry git commit: NIFIREG-24 Adding RPM profile to assembly. This closes #13.

Repository: nifi-registry
Updated Branches:
  refs/heads/master d6159f834 -> a87d42ee9


NIFIREG-24 Adding RPM profile to assembly. This closes #13.


Project: http://git-wip-us.apache.org/repos/asf/nifi-registry/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-registry/commit/a87d42ee
Tree: http://git-wip-us.apache.org/repos/asf/nifi-registry/tree/a87d42ee
Diff: http://git-wip-us.apache.org/repos/asf/nifi-registry/diff/a87d42ee

Branch: refs/heads/master
Commit: a87d42ee98c6eb04f6230656172e134fdf356448
Parents: d6159f8
Author: Bryan Bende <bb...@apache.org>
Authored: Thu Sep 28 10:08:58 2017 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Thu Sep 28 14:17:22 2017 -0400

----------------------------------------------------------------------
 nifi-registry-assembly/pom.xml | 178 ++++++++++++++++++++++++++++++++++++
 pom.xml                        |  10 --
 2 files changed, 178 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/a87d42ee/nifi-registry-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-registry-assembly/pom.xml b/nifi-registry-assembly/pom.xml
index 7ed4ff0..dbed960 100644
--- a/nifi-registry-assembly/pom.xml
+++ b/nifi-registry-assembly/pom.xml
@@ -116,6 +116,7 @@
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
     </dependencies>
+
     <properties>
         <!-- nifi-registry.properties: web properties -->
         <nifi.registry.web.war.directory>./lib</nifi.registry.web.war.directory>
@@ -144,4 +145,181 @@
         <nifi.registry.db.directory>./database</nifi.registry.db.directory>
         <nifi.registry.db.url.append>;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE</nifi.registry.db.url.append>
     </properties>
+
+    <profiles>
+        <profile>
+            <id>rpm</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <properties>
+                <nifi.registry.run.as>nifi</nifi.registry.run.as>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>unpack-shared-resources</id>
+                                <goals>
+                                    <goal>unpack-dependencies</goal>
+                                </goals>
+                                <phase>generate-resources</phase>
+                                <configuration>
+                                    <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
+                                    <includeArtifactIds>nifi-registry-resources</includeArtifactIds>
+                                    <includeGroupIds>org.apache.nifi.registry</includeGroupIds>
+                                    <excludeTransitive>false</excludeTransitive>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>rpm-maven-plugin</artifactId>
+                        <configuration>
+                            <name>nifi-registry</name>
+                            <summary>Apache NiFi Registry</summary>
+                            <description>A sub-project of Apache NiFi that provides a central location for storage and management of shared resources across one or more instances of NiFi and/or MiNiFi.</description>
+                            <license>Apache License, Version 2.0 and others (see included LICENSE file)</license>
+                            <url>https://nifi.apache.org/registry.html</url>
+                            <group>Utilities</group>
+                            <prefix>/opt/nifi-registry</prefix>
+                            <defineStatements>
+                                <defineStatement>_use_internal_dependency_generator 0</defineStatement>
+                            </defineStatements>
+                            <defaultDirmode>750</defaultDirmode>
+                            <defaultFilemode>640</defaultFilemode>
+                            <defaultUsername>nifi</defaultUsername>
+                            <defaultGroupname>nifi</defaultGroupname>
+                            <!-- This allows the stanza to produce bootstrap.conf that is pre-configured with run.as=nifi
+                            given the uid is created by the preinstallScriptlet below. Meanwhile, normal zip and tar.gz
+                            ship without this particular property set -->
+                            <installScriptlet>
+                                <!-- It is important to note because of the way the plugin calls the command, the sed backup
+                                parameter -i and the sed command do not beed to be wrapped by single or double quotes.
+                                Also note maven properties are processed before RPM variables and before sed commands -->
+                                <script>sed -i s/^run\.as=$/run\.as=${nifi.registry.run.as}/ $RPM_BUILD_ROOT/opt/nifi-registry/nifi-registry-${project.version}/conf/bootstrap.conf</script>
+                            </installScriptlet>
+                            <preinstallScriptlet>
+                                <script>/usr/bin/getent group nifi &gt;/dev/null || /usr/sbin/groupadd -r nifi; /usr/bin/getent passwd nifi &gt;/dev/null || /usr/sbin/useradd -r -g nifi -d /opt/nifi-registry -s /sbin/nologin -c "NiFi System User" nifi</script>
+                            </preinstallScriptlet>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>build-bin-rpm</id>
+                                <goals>
+                                    <goal>attached-rpm</goal>
+                                </goals>
+                                <configuration>
+                                    <group>Apache NiFI</group>
+                                    <classifier>bin</classifier>
+                                    <provides>
+                                        <provide>nifi-registry</provide>
+                                    </provides>
+                                    <mappings>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}</directory>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}</directory>
+                                            <sources>
+                                                <source>
+                                                    <location>./LICENSE</location>
+                                                </source>
+                                                <source>
+                                                    <location>./NOTICE</location>
+                                                </source>
+                                                <source>
+                                                    <location>./README.md</location>
+                                                    <destination>README</destination>
+                                                </source>
+                                            </sources>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry</directory>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/bin</directory>
+                                            <filemode>750</filemode>
+                                            <sources>
+                                                <source>
+                                                    <location>${project.build.directory}/generated-resources/bin/nifi-registry.sh</location>
+                                                    <destination>nifi-registry.sh</destination>
+                                                    <filter>true</filter>
+                                                </source>
+                                                <source>
+                                                    <location>${project.build.directory}/generated-resources/bin/nifi-registry-env.sh</location>
+                                                    <destination>nifi-registry-env.sh</destination>
+                                                    <filter>true</filter>
+                                                </source>
+                                            </sources>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/conf</directory>
+                                            <configuration>true</configuration>
+                                            <sources>
+                                                <source>
+                                                    <location>${project.build.directory}/generated-resources/conf</location>
+                                                    <filter>true</filter>
+                                                </source>
+                                            </sources>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/lib</directory>
+                                        </mapping>
+                                        <!--
+                                            The lib/shared mapping includes the common dependencies between the registry
+                                            application (lib) and registry bootstrap (lib/bootstrap).
+
+                                            The lib/bootstrap mapping then excludes what was in lib/shared and includes
+                                            the other dependencies needed for the registry bootstrap.
+
+                                            The lib mapping excludes what was in lib/shared and excluded the bootstrap module,
+                                            and would bring in everything else from the lib directory of a non RPM build.
+                                            -->
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/lib</directory>
+                                            <dependency>
+                                                <excludes>
+                                                    <exclude>org.apache.commons:commons-lang3</exclude>
+                                                    <exclude>org.apache.nifi.registry:nifi-registry-utils</exclude>
+                                                    <exclude>org.apache.nifi.registry:nifi-registry-bootstrap</exclude>
+                                                </excludes>
+                                            </dependency>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/lib/bootstrap</directory>
+                                            <dependency>
+                                                <includes>
+                                                    <include>org.slf4j:slf4j-api</include>
+                                                    <include>ch.qos.logback:logback-classic</include>
+                                                    <include>ch.qos.logback:logback-core</include>
+                                                    <include>org.apache.nifi.registry:nifi-registry-bootstrap</include>
+                                                </includes>
+                                                <excludes>
+                                                    <exclude>org.apache.commons:commons-lang3</exclude>
+                                                    <exclude>org.apache.nifi.registry:nifi-registry-utils</exclude>
+                                                </excludes>
+                                            </dependency>
+                                        </mapping>
+                                        <mapping>
+                                            <directory>/opt/nifi-registry/nifi-registry-${project.version}/lib/shared</directory>
+                                            <dependency>
+                                                <includes>
+                                                    <include>org.apache.commons:commons-lang3</include>
+                                                    <include>org.apache.nifi.registry:nifi-registry-utils</include>
+                                                </includes>
+                                            </dependency>
+                                        </mapping>
+                                    </mappings>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/a87d42ee/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b46f111..1c61e41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -210,11 +210,6 @@
             </dependency>
             <dependency>
                 <groupId>org.eclipse.jetty</groupId>
-                <artifactId>jetty-annotations</artifactId>
-                <version>${jetty.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.eclipse.jetty</groupId>
                 <artifactId>apache-jsp</artifactId>
                 <version>${jetty.version}</version>
             </dependency>
@@ -224,11 +219,6 @@
                 <version>${jetty.version}</version>
             </dependency>
             <dependency>
-                <groupId>org.apache.commons</groupId>
-                <artifactId>commons-lang3</artifactId>
-                <version>3.4</version>
-            </dependency>
-            <dependency>
                 <groupId>javax.servlet</groupId>
                 <artifactId>javax.servlet-api</artifactId>
                 <version>3.1.0</version>