]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4636 Use Maven WAR overlay for branding resources
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 16 May 2014 10:22:37 +0000 (12:22 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Tue, 20 May 2014 06:40:31 +0000 (08:40 +0200)
sonar-server/pom.xml
sonar-server/src/main/erb/branding/_footer.html.erb [deleted file]
sonar-server/src/main/erb/branding/logo.png [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/branding/_footer.html.erb

index 9ad742f721f3e9748bd9b7bb8e7932117864ae52..3318c123d340fae9b91722971cae712091c7ad74 100644 (file)
@@ -13,7 +13,6 @@
 
   <properties>
     <gruntTask>default</gruntTask>
-    <branding.url>file:${basedir}/src/main/erb/branding</branding.url>
 
     <!-- self-analysis -->
     <sonar.sources>src/main/java,src/main/js</sonar.sources>
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>download-branding-resources</id>
-            <phase>prepare-package</phase>
-            <goals>
-              <goal>run</goal>
-            </goals>
-            <configuration>
-              <target>
-                <!-- download file -->
-                <mkdir dir="${project.build.directory}/${project.build.finalName}/branding/WEB-INF/app/views/branding"/>
-                <mkdir dir="${project.build.directory}/${project.build.finalName}/branding/images"/>
-                <get src="${branding.url}/_footer.html.erb"
-                    dest="${project.build.directory}/${project.build.finalName}/branding/WEB-INF/app/views/branding"
-                    verbose="false"
-                    usetimestamp="false"/>
-                <get src="${branding.url}/logo.png"
-                    dest="${project.build.directory}/${project.build.finalName}/branding/images"
-                    verbose="false"
-                    usetimestamp="false"/>
-              </target>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
-          <webResources>
-            <resource>
-              <directory>${project.build.directory}/${project.build.finalName}/branding</directory>
-              <include>**/*</include>
-            </resource>
-          </webResources>
           <packagingExcludes>
             **/*.log,*.iml,WEB-INF/script/,WEB-INF/test/,javascripts/*-min.js,stylesheets/*-min.css,javascripts/tests/**/*,
             build/**,coffee/**,less/**,templates/**
               <skip>true</skip>
             </configuration>
           </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-war-plugin</artifactId>
+            <configuration>
+              <overlays>
+                <overlay>
+                  <groupId>com.sonarsource</groupId>
+                  <artifactId>sonarsource-branding</artifactId>
+                  <!-- branding resources are added first -->
+                </overlay>
+                <overlay>
+                  <!-- empty groupId/artifactId represents the current build => branding not overwritten -->
+                </overlay>
+              </overlays>
+            </configuration>
+          </plugin>
         </plugins>
       </build>
+      <dependencies>
+        <dependency>
+          <groupId>com.sonarsource</groupId>
+          <artifactId>sonarsource-branding</artifactId>
+          <version>0.1-SNAPSHOT</version>
+          <type>war</type>
+          <scope>runtime</scope>
+        </dependency>
+      </dependencies>
     </profile>
   </profiles>
 
diff --git a/sonar-server/src/main/erb/branding/_footer.html.erb b/sonar-server/src/main/erb/branding/_footer.html.erb
deleted file mode 100644 (file)
index 332b769..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<div>
-  This application is based on
-  <a href="http://www.sonarqube.org/" title="SonarQube&trade;">SonarQube&trade;</a>
-  but is <em>not</em> an official version provided by
-  <a href="http://www.sonarsource.com" title="SonarSource SA">SonarSource SA</a>.
-</div>
diff --git a/sonar-server/src/main/erb/branding/logo.png b/sonar-server/src/main/erb/branding/logo.png
deleted file mode 100644 (file)
index 427fb75..0000000
Binary files a/sonar-server/src/main/erb/branding/logo.png and /dev/null differ
index 63abc76f030e00a87a97b880a32366a11d8ef870..332b7691a1e23bed613cc22bcf20f7302a49998d 100644 (file)
@@ -1 +1,6 @@
-<div>TODO</div>
+<div>
+  This application is based on
+  <a href="http://www.sonarqube.org/" title="SonarQube&trade;">SonarQube&trade;</a>
+  but is <em>not</em> an official version provided by
+  <a href="http://www.sonarsource.com" title="SonarSource SA">SonarSource SA</a>.
+</div>