]> source.dussan.org Git - sonarqube.git/commitdiff
Completing integration of grunt into maven
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 20 Mar 2014 11:32:24 +0000 (12:32 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 20 Mar 2014 11:32:24 +0000 (12:32 +0100)
pom.xml
sonar-server/pom.xml

diff --git a/pom.xml b/pom.xml
index 70ef07f750bd09401ad9591cfd4bc8302b1074c4..27d643cb7474f26c9ecb923fb3099c1ebd9a0827 100644 (file)
--- a/pom.xml
+++ b/pom.xml
             <skip>${skipSanityChecks}</skip>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>com.github.eirslett</groupId>
+          <artifactId>frontend-maven-plugin</artifactId>
+          <version>0.0.14</version>
+        </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-antrun-plugin</artifactId>
           <artifactId>sonar-packaging-maven-plugin</artifactId>
           <version>1.9</version>
         </plugin>
-        <plugin>
-          <groupId>ro.isdc.wro4j</groupId>
-          <artifactId>wro4j-maven-plugin</artifactId>
-          <version>1.7.2</version>
-        </plugin>
       </plugins>
     </pluginManagement>
 
index e4a27b17fa14eda9b9e433a47882ffb480df97eb..7c2e4575ad84ccf405b1b84d2347c32ac50dcd2b 100644 (file)
   <packaging>war</packaging>
   <name>SonarQube :: Server</name>
 
+  <properties>
+    <gruntTask>default</gruntTask>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>com.google.code.gson</groupId>
       <plugin>
         <groupId>com.github.eirslett</groupId>
         <artifactId>frontend-maven-plugin</artifactId>
-        <version>0.0.14</version>
         <executions>
           <execution>
             <phase>generate-resources</phase>
             <goals>
               <goal>grunt</goal>
             </goals>
+            <configuration>
+              <arguments>${gruntTask}</arguments>
+            </configuration>
           </execution>
         </executions>
       </plugin>
       <plugin>
-        <groupId>ro.isdc.wro4j</groupId>
-        <artifactId>wro4j-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>prepare-package</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <targetGroups>sonar</targetGroups>
-          <minimize>true</minimize>
-          <cssDestinationFolder>${project.build.directory}/${project.build.finalName}/stylesheets</cssDestinationFolder>
-          <jsDestinationFolder>${project.build.directory}/${project.build.finalName}/javascripts</jsDestinationFolder>
-          <contextFolder>${basedir}/src/main/webapp/</contextFolder>
-          <wroFile>${basedir}/wro.xml</wroFile>
-          <wroManagerFactory>ro.isdc.wro.extensions.manager.standalone.GoogleStandaloneManagerFactory
-          </wroManagerFactory>
-          <ignoreMissingResources>false</ignoreMissingResources>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>com.github.bringking</groupId>
-        <artifactId>requirejs-maven-plugin</artifactId>
-        <version>2.0.3</version>
+        <artifactId>maven-resources-plugin</artifactId>
         <executions>
           <execution>
-            <phase>prepare-package</phase>
+            <id>copy-generated-webapp</id>
+            <!-- must be after the execution of grunt -->
+            <phase>process-resources</phase>
             <goals>
-              <goal>optimize</goal>
+              <goal>copy-resources</goal>
             </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+              <overwrite>false</overwrite>
+              <resources>
+                <resource>
+                  <directory>src/main/webapp/build</directory>
+                  <filtering>false</filtering>
+                </resource>
+              </resources>
+            </configuration>
           </execution>
         </executions>
-        <configuration>
-          <configFile>${basedir}/src/main/webapp/javascripts/build.js</configFile>
-          <optimizerParameters>
-            <parameter>dir=${project.build.directory}/${project.build.finalName}/javascripts</parameter>
-            <parameter>skipDirOptimize=true</parameter>
-            <parameter>keepBuildDir=true</parameter>
-          </optimizerParameters>
-        </configuration>
       </plugin>
 
       <plugin>
           </execution>
         </executions>
       </plugin>
-
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
           <packagingExcludes>
-            **/*.log,*.iml,WEB-INF/script/,WEB-INF/test/,javascripts/*-min.js,stylesheets/*-min.css,javascripts/tests/**/*
+            **/*.log,*.iml,WEB-INF/script/,WEB-INF/test/,javascripts/*-min.js,stylesheets/*-min.css,javascripts/tests/**/*,
+            build/**,coffee/**,less/**,templates/**
           </packagingExcludes>
           <warSourceExcludes>
             **/*
   <profiles>
     <profile>
       <id>start-dev-server</id>
+      <properties>
+        <gruntTask>dev</gruntTask>
+      </properties>
       <build>
         <plugins>
           <plugin>
         </plugins>
       </build>
     </profile>
-
-    <profile>
-      <!-- experimental profile -->
-      <id>js</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>com.kelveden</groupId>
-            <artifactId>maven-karma-plugin</artifactId>
-            <version>1.5</version>
-            <configuration>
-              <configFile>${basedir}/karma.conf.js</configFile>
-            </configuration>
-            <executions>
-              <execution>
-                <id>karma</id>
-                <goals>
-                  <goal>start</goal>
-                </goals>
-                <phase>process-test-classes</phase>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
   </profiles>
 
 </project>