Explorar el Código

AMBARI-5732 - Views: Pig and File Views need to be built and packaged as part of Ambari

tbeerbower hace 11 años
padre
commit
ca3cce1a5f
Se han modificado 5 ficheros con 119 adiciones y 32 borrados
  1. 14 0
      ambari-server/pom.xml
  2. 26 0
      contrib/views/files/pom.xml
  3. 26 2
      contrib/views/pig/pom.xml
  4. 50 29
      contrib/views/pom.xml
  5. 3 1
      pom.xml

+ 14 - 0
ambari-server/pom.xml

@@ -245,6 +245,20 @@
                 </source>
               </sources>
             </mapping>
+            <!-- Put the contrib views in the view directory for deployment -->
+            <mapping>
+              <directory>/var/lib/ambari-server/resources/views</directory>
+              <sources>
+                <source>
+                  <location>
+                    ${project.basedir}/../contrib/views/target/views
+                  </location>
+                  <includes>
+                    <include>*.jar</include>
+                  </includes>
+                </source>
+              </sources>
+            </mapping>
             <mapping>
               <directory>${common_functions.install.dir}</directory>
               <sources>

+ 26 - 0
contrib/views/files/pom.xml

@@ -182,6 +182,32 @@
             </execution>
         </executions>
         </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>attached</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+          <outputDirectory>${basedir}/target</outputDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
     </plugins>
     <resources>
         <resource>

+ 26 - 2
contrib/views/pig/pom.xml

@@ -175,9 +175,33 @@
           </execution>
         </executions>
       </plugin>
-
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>attached</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <descriptorRefs>
+            <descriptorRef>jar-with-dependencies</descriptorRef>
+          </descriptorRefs>
+          <outputDirectory>${basedir}/target</outputDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
     </plugins>
-
     <resources>
       <resource>
         <directory>src/main/resources</directory>

+ 50 - 29
contrib/views/pom.xml

@@ -18,10 +18,10 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.ambari.views</groupId>
-  <artifactId>ambari-views</artifactId>
+  <artifactId>ambari-contrib-views</artifactId>
   <packaging>pom</packaging>
   <version>0.1.0-SNAPSHOT</version>
-  <name>Ambari Views</name>
+  <name>Ambari Contrib Views</name>
   <modules>
     <module>files</module>
     <module>pig</module>
@@ -62,35 +62,56 @@
           </excludes>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <goals>
-              <goal>attached</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
-          <outputDirectory>${basedir}/target</outputDirectory>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>3.1</version>
-        <configuration>
-          <source>1.6</source>
-          <target>1.6</target>
-        </configuration>
-      </plugin>
     </plugins>
-
   </build>
+  <profiles>
+    <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <!-- Copy only the contrib views that we want included for default deployment -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-amabri-views</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <!-- View archives in target/views will be deployed with an Ambari server install -->
+                  <outputDirectory>${basedir}/target/views</outputDirectory>
+                  <resources>
+                    <!-- PIG view -->
+                    <resource>
+                      <directory>${basedir}/pig/target/</directory>
+                      <includes>
+                        <include>*-dependencies.jar</include>
+                      </includes>
+                      <filtering>true</filtering>
+                    </resource>
+                    <!-- FILES view -->
+                    <resource>
+                      <directory>${basedir}/files/target/</directory>
+                      <includes>
+                        <include>*-dependencies.jar</include>
+                      </includes>
+                      <filtering>true</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
   <dependencyManagement>
     <dependencies>
       <dependency>

+ 3 - 1
pom.xml

@@ -167,7 +167,7 @@
             <exclude>derby.log</exclude>
             <exclude>CHANGES.txt</exclude>
             <exclude>pass.txt</exclude>
-            <exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>
+                   <exclude>contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase</exclude>
             <exclude>contrib/ambari-scom/msi/src/GUI_Ambari.sln</exclude>
             <exclude>version</exclude>
             <!--IDE and GIT files-->
@@ -239,6 +239,7 @@
         <module>ambari-web</module>
         <module>ambari-project</module>
         <module>ambari-views</module>
+        <module>contrib/views/</module>
         <module>ambari-server</module>
         <module>ambari-agent</module>
         <module>ambari-client</module>
@@ -249,6 +250,7 @@
       <modules>
         <module>ambari-project</module>
         <module>ambari-views</module>
+        <module>contrib/views/</module>
         <module>ambari-server</module>
         <module>ambari-agent</module>
         <module>ambari-client</module>