changeset 201:f65dffb9f0f0

Service configuration should be in the service module Reviewed-by: jerboaa Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-July/024039.html
author Christopher Koehler <chkoehle@redhat.com>
date Tue, 18 Jul 2017 10:36:46 -0400
parents 4d6991d2839d
children c0140877e78b
files config-assembly/pom.xml config-assembly/src/main/resources/assemblies/config.xml distribution/pom.xml distribution/src/assembly/plugin-assembly.xml distribution/src/etc/commands/basic-users.properties distribution/src/etc/commands/service-config.properties pom.xml services/commands/etc/commands/basic-users.properties services/commands/etc/commands/service-config.properties services/commands/pom.xml
diffstat 10 files changed, 249 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config-assembly/pom.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2012-2017 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses/>.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>com.redhat.thermostat</groupId>
+        <artifactId>thermostat-web-gateway</artifactId>
+        <version>1.99.12-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>thermostat-web-gateway-config-assembly</artifactId>
+
+    <name>Thermostat Web Gateway Config Assembler</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config-assembly/src/main/resources/assemblies/config.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2012-2017 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses/>.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>config</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <includes>
+                <include>etc/${thermostat.microservice.name}/*</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+        </fileSet>
+    </fileSets>
+</assembly>
--- a/distribution/pom.xml	Mon Jul 17 15:12:53 2017 -0400
+++ b/distribution/pom.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -107,6 +107,20 @@
                             <goal>single</goal>
                         </goals>
                     </execution>
+                    <execution>
+                        <id>plugin-assembly</id>
+                        <configuration>
+                            <finalName>image</finalName>
+                            <descriptors>
+                                <descriptor>src/assembly/plugin-assembly.xml</descriptor>
+                            </descriptors>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
                 </executions>
             </plugin>
             <plugin>
@@ -321,5 +335,14 @@
             <type>war</type>
             <scope>provided</scope>
         </dependency>
+
+        <!-- src/etc/ dependencies from other services -->
+        <dependency>
+            <groupId>com.redhat.thermostat</groupId>
+            <artifactId>thermostat-web-gateway-service-commands</artifactId>
+            <version>${project.version}</version>
+            <classifier>config</classifier>
+            <type>zip</type>
+        </dependency>
     </dependencies>
 </project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/distribution/src/assembly/plugin-assembly.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2012-2017 Red Hat, Inc.
+
+ This file is part of Thermostat.
+
+ Thermostat is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ Thermostat is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Thermostat; see the file COPYING.  If not see
+ <http://www.gnu.org/licenses/>.
+
+ Linking this code with other modules is making a combined work
+ based on this code.  Thus, the terms and conditions of the GNU
+ General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this code give
+ you permission to link this code with independent modules to
+ produce an executable, regardless of the license terms of these
+ independent modules, and to copy and distribute the resulting
+ executable under terms of your choice, provided that you also
+ meet, for each linked independent module, the terms and conditions
+ of the license of that module.  An independent module is a module
+ which is not derived from or based on this code.  If you modify
+ this code, you may extend this exception to your version of the
+ library, but you are not obligated to do so.  If you do not wish
+ to do so, delete this exception statement from your version.
+
+-->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>plugin-assembly</id>
+    <formats>
+        <format>dir</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <dependencySets>
+        <dependencySet>
+            <useProjectArtifact>false</useProjectArtifact>
+            <unpack>true</unpack>
+            <includes>
+                <include>com.redhat.thermostat:thermostat-web-gateway-service-commands</include>
+            </includes>
+            <unpackOptions>
+                <includes>
+                    <include>**</include>
+                </includes>
+            </unpackOptions>
+        </dependencySet>
+    </dependencySets>
+</assembly>
--- a/distribution/src/etc/commands/basic-users.properties	Mon Jul 17 15:12:53 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-# Agent user(s)
-foo-agent-user=agent-pwd,thermostat-commands-realm,thermostat-commands-provider-testAgent
-agent-user=agent-pwd,thermostat-commands-realm,thermostat-commands-provider-otherAgent
-# Client user
-bar-client-user=client-pwd,thermostat-commands-realm,thermostat-commands-grant-dump-heap,thermostat-commands-grant-jvm-abc
\ No newline at end of file
--- a/distribution/src/etc/commands/service-config.properties	Mon Jul 17 15:12:53 2017 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-SECURITY_BASIC=true
-properties|SECURITY_BASIC_USERS=basic-users.properties
-WEBSOCKETS=true
\ No newline at end of file
--- a/pom.xml	Mon Jul 17 15:12:53 2017 -0400
+++ b/pom.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -52,6 +52,7 @@
         <module>server</module>
         <module>distribution</module>
         <module>common</module>
+        <module>config-assembly</module>
         <module>services</module>
         <module>ide-launcher</module>
         <module>tests</module>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/commands/etc/commands/basic-users.properties	Tue Jul 18 10:36:46 2017 -0400
@@ -0,0 +1,5 @@
+# Agent user(s)
+foo-agent-user=agent-pwd,thermostat-commands-realm,thermostat-commands-provider-testAgent
+agent-user=agent-pwd,thermostat-commands-realm,thermostat-commands-provider-otherAgent
+# Client user
+bar-client-user=client-pwd,thermostat-commands-realm,thermostat-commands-grant-dump-heap,thermostat-commands-grant-jvm-abc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/services/commands/etc/commands/service-config.properties	Tue Jul 18 10:36:46 2017 -0400
@@ -0,0 +1,3 @@
+SECURITY_BASIC=true
+properties|SECURITY_BASIC_USERS=basic-users.properties
+WEBSOCKETS=true
\ No newline at end of file
--- a/services/commands/pom.xml	Mon Jul 17 15:12:53 2017 -0400
+++ b/services/commands/pom.xml	Tue Jul 18 10:36:46 2017 -0400
@@ -50,6 +50,41 @@
 
   <name>Thermostat Web Gateway Command Channel Service</name>
 
+  <properties>
+    <thermostat.microservice.name>commands</thermostat.microservice.name>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>3.0.0</version>
+        <dependencies>
+          <dependency>
+            <groupId>com.redhat.thermostat</groupId>
+            <artifactId>thermostat-web-gateway-config-assembly</artifactId>
+            <version>${project.version}</version>
+          </dependency>
+        </dependencies>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>config</descriptorRef>
+          </descriptorRefs>
+          <appendAssemblyId>true</appendAssemblyId>
+        </configuration>
+        <executions>
+          <execution>
+            <id>assemble-plugin</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
   <dependencies>
   
     <!-- Thermostat Web Gateway Dependencies -->
@@ -59,7 +94,7 @@
       <version>${project.version}</version>
       <scope>provided</scope>
     </dependency>
-        
+
     <!-- Websockets deps -->
     <dependency>
       <groupId>javax.websocket</groupId>