[NO ISSUE][*DB] More complete bypass of dashboard build for -P skip-dashboard

Change-Id: I7e4a8a0693d5bcbe711947ffc219dd4363ac5b41
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/6003
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-dashboard/pom.xml b/asterixdb/asterix-dashboard/pom.xml
index ff4234f..75fb8d2 100644
--- a/asterixdb/asterix-dashboard/pom.xml
+++ b/asterixdb/asterix-dashboard/pom.xml
@@ -55,120 +55,131 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>com.github.eirslett</groupId>
-        <artifactId>frontend-maven-plugin</artifactId>
-        <version>1.6</version>
-        <configuration>
-          <nodeVersion>v10.3.0</nodeVersion>
-          <npmVersion>6.1.0</npmVersion>
-          <workingDirectory>target/dashboard</workingDirectory>
-          <installDirectory>target/dashboard</installDirectory>
-        </configuration>
-        <executions>
-          <execution>
-            <id>install node and yarn</id>
-            <goals>
-              <goal>install-node-and-npm</goal>
-            </goals>
-            <phase>generate-resources</phase>
-          </execution>
-          <execution>
-            <id>npm install</id>
-            <phase>process-resources</phase>
-            <goals>
-              <goal>npm</goal>
-            </goals>
+  <profiles>
+    <profile>
+      <id>include-dashboard</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>com.github.eirslett</groupId>
+            <artifactId>frontend-maven-plugin</artifactId>
+            <version>1.6</version>
             <configuration>
-              <arguments>install --cache ${settings.localRepository}/.npm-cache --no-optional</arguments>
+              <nodeVersion>v10.3.0</nodeVersion>
+              <npmVersion>6.1.0</npmVersion>
+              <workingDirectory>target/dashboard</workingDirectory>
+              <installDirectory>target/dashboard</installDirectory>
             </configuration>
-          </execution>
-          <execution>
-            <id>npm run-script mavenbuild</id>
-            <phase>compile</phase>
-            <goals>
-              <goal>npm</goal>
-            </goals>
+            <executions>
+              <execution>
+                <id>install node and yarn</id>
+                <goals>
+                  <goal>install-node-and-npm</goal>
+                </goals>
+                <phase>generate-resources</phase>
+              </execution>
+              <execution>
+                <id>npm install</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>npm</goal>
+                </goals>
+                <configuration>
+                  <arguments>install --cache ${settings.localRepository}/.npm-cache --no-optional</arguments>
+                </configuration>
+              </execution>
+              <execution>
+                <id>npm run-script mavenbuild</id>
+                <phase>compile</phase>
+                <goals>
+                  <goal>npm</goal>
+                </goals>
+                <configuration>
+                  <arguments>run-script mavenbuild</arguments>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>copy-static</id>
+                <phase>${resource.stage}</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>
+                    ${basedir}/target/classes/dashboard/
+                  </outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>${basedir}/target/dashboard/static/
+                      </directory>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+              <execution>
+                <id>copy-node</id>
+                <phase>validate</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>
+                    ${basedir}/target/dashboard
+                  </outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>${basedir}/src/node
+                      </directory>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.hyracks</groupId>
+            <artifactId>license-automation-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>${license.stage}</phase>
+                <goals>
+                  <goal>generate</goal>
+                </goals>
+              </execution>
+            </executions>
             <configuration>
-              <arguments>run-script mavenbuild</arguments>
+              <templateRootDir>${basedir}</templateRootDir>
+              <outputDir>${project.build.directory}/classes/META-INF</outputDir>
+              <generatedFiles>
+                <generatedFile>
+                  <template>src/main/licenses/dashboard-license.ftl</template>
+                  <outputFile>LICENSE</outputFile>
+                </generatedFile>
+              </generatedFiles>
+              <location>repo/</location>
+              <timeoutSecs>10</timeoutSecs>
+              <downloadDir>
+                ${project.build.directory}/generated-resources/license
+              </downloadDir>
+              <excludedScopes>
+                <excludedScope>test</excludedScope>
+              </excludedScopes>
+              <licenseDirectory>${basedir}/src/main/licenses/content</licenseDirectory>
             </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-resources-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>copy-static</id>
-            <phase>${resource.stage}</phase>
-            <goals>
-              <goal>copy-resources</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>
-                ${basedir}/target/classes/dashboard/
-              </outputDirectory>
-              <resources>
-                <resource>
-                  <directory>${basedir}/target/dashboard/static/
-                  </directory>
-                </resource>
-              </resources>
-            </configuration>
-          </execution>
-          <execution>
-            <id>copy-node</id>
-            <phase>validate</phase>
-            <goals>
-              <goal>copy-resources</goal>
-            </goals>
-            <configuration>
-              <outputDirectory>
-                ${basedir}/target/dashboard
-              </outputDirectory>
-              <resources>
-                <resource>
-                  <directory>${basedir}/src/node
-                  </directory>
-                </resource>
-              </resources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.hyracks</groupId>
-        <artifactId>license-automation-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>${license.stage}</phase>
-            <goals>
-              <goal>generate</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <templateRootDir>${basedir}</templateRootDir>
-          <outputDir>${project.build.directory}/classes/META-INF</outputDir>
-          <generatedFiles>
-            <generatedFile>
-              <template>src/main/licenses/dashboard-license.ftl</template>
-              <outputFile>LICENSE</outputFile>
-            </generatedFile>
-          </generatedFiles>
-          <location>repo/</location>
-          <timeoutSecs>10</timeoutSecs>
-          <downloadDir>
-            ${project.build.directory}/generated-resources/license
-          </downloadDir>
-          <excludedScopes>
-            <excludedScope>test</excludedScope>
-          </excludedScopes>
-          <licenseDirectory>${basedir}/src/main/licenses/content</licenseDirectory>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>skip-dashboard</id>
+    </profile>
+  </profiles>
 </project>
diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml
index 96a1998..6760333 100644
--- a/asterixdb/pom.xml
+++ b/asterixdb/pom.xml
@@ -616,19 +616,6 @@
       </properties>
     </profile>
     <profile>
-      <id>skip-dashboard</id>
-      <activation>
-        <property>
-          <name>skip.npm</name>
-          <value>true</value>
-        </property>
-      </activation>
-      <properties>
-        <license.stage>none</license.stage>
-        <resource.stage>none</resource.stage>
-      </properties>
-    </profile>
-    <profile>
       <id>invalid-tests</id>
       <properties>
         <invalid.tests />