Browse Source

AMBARI-14936. Tweaks to reduce build time (aonishuk)

Andrew Onishuk 9 năm trước cách đây
mục cha
commit
dc8e5c3c68
5 tập tin đã thay đổi với 27 bổ sung42 xóa
  1. 20 20
      ambari-agent/pom.xml
  2. 3 3
      ambari-server/pom.xml
  3. 1 1
      ambari-server/src/main/assemblies/server.xml
  4. 2 1
      ambari-web/pom.xml
  5. 1 17
      pom.xml

+ 20 - 20
ambari-agent/pom.xml

@@ -88,24 +88,6 @@
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.0</version>
       </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <tarLongFileMode>gnu</tarLongFileMode>
-          <descriptors>
-            <descriptor>src/packages/tarball/all.xml</descriptor>
-          </descriptors>
-        </configuration>
-        <executions>
-          <execution>
-            <id>build-tarball</id>
-            <phase>prepare-package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
@@ -263,6 +245,24 @@
           </dataSet>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <tarLongFileMode>gnu</tarLongFileMode>
+          <descriptors>
+            <descriptor>src/packages/tarball/all.xml</descriptor>
+          </descriptors>
+        </configuration>
+        <executions>
+          <execution>
+            <id>build-tarball</id>
+            <phase>${assemblyPhase}</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <artifactId>maven-resources-plugin</artifactId>
         <version>2.6</version>
@@ -336,7 +336,7 @@
           </execution>
           <execution>
             <id>copy-repo-resources</id>
-            <phase>package</phase>
+            <phase>${assemblyPhase}</phase>
             <goals>
               <goal>copy-resources</goal>
             </goals>
@@ -367,7 +367,7 @@
         <executions>
           <execution>
             <id>rename-file</id>
-            <phase>package</phase>
+            <phase>${assemblyPhase}</phase>
             <goals>
               <goal>rename</goal>
             </goals>

+ 3 - 3
ambari-server/pom.xml

@@ -137,7 +137,7 @@
         <executions>
           <execution>
             <id>build-tarball</id>
-            <phase>package</phase>
+            <phase>${assemblyPhase}</phase>
             <goals>
               <goal>single</goal>
             </goals>
@@ -176,7 +176,7 @@
           </execution>
           <execution>
             <id>copy-repo-resources</id>
-            <phase>package</phase>
+            <phase>${assemblyPhase}</phase>
             <goals>
               <goal>copy-resources</goal>
             </goals>
@@ -207,7 +207,7 @@
         <executions>
           <execution>
             <id>rename-file</id>
-            <phase>package</phase>
+            <phase>${assemblyPhase}</phase>
             <goals>
               <goal>rename</goal>
             </goals>

+ 1 - 1
ambari-server/src/main/assemblies/server.xml

@@ -306,7 +306,7 @@
     </file>
     <file>
       <fileMode>755</fileMode>
-      <source>target/classes/stacks/stack_advisor.py</source>
+      <source>src/main/resources/stacks/stack_advisor.py</source>
       <outputDirectory>/var/lib/ambari-server/resources/stacks</outputDirectory>
     </file>
     <file>

+ 2 - 1
ambari-web/pom.xml

@@ -32,6 +32,7 @@
   <properties>
     <ambari.dir>${project.parent.parent.basedir}</ambari.dir>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <nodemodules.dir>node_modules</nodemodules.dir> <!-- specify -Dnodemodules.dir option to reduce ambari-web build time by not re-downloading npm modules -->
   </properties>
   <build>
     <plugins>
@@ -100,7 +101,7 @@
             <configuration>
               <executable>${executable.rmdir}</executable>
               <workingDirectory>${basedir}</workingDirectory>
-              <commandlineArgs>${args.rm.clean} public node_modules</commandlineArgs>
+              <commandlineArgs>${args.rm.clean} public ${nodemodules.dir}</commandlineArgs>
               <successCodes>
                 <successCode>0</successCode>
                 <successCode>1</successCode>

+ 1 - 17
pom.xml

@@ -60,6 +60,7 @@
     <distMgmtStagingId>apache.staging.https</distMgmtStagingId>
     <distMgmtStagingName>Apache Release Distribution Repository</distMgmtStagingName>
     <distMgmtStagingUrl>https://repository.apache.org/service/local/staging/deploy/maven2</distMgmtStagingUrl>
+    <assemblyPhase>package</assemblyPhase> <!-- use -DassemblyPhase=none to skip building tarball, useful when you want purely compile jar -->
   </properties>
   <pluginRepositories>
     <pluginRepository>
@@ -202,23 +203,6 @@
           <target>1.7</target>
         </configuration>
       </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <descriptors>
-            <descriptor>${ambari.dir}/ambari-project/src/main/assemblies/empty.xml</descriptor>
-          </descriptors>
-        </configuration>
-        <executions>
-          <execution>
-            <id>make-assembly</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>rpm-maven-plugin</artifactId>