Sonarqube custom rules: custom plugin for JavaScript
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Fri, 5 Aug 2016 01:01:56 +0000 (03:01 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Fri, 5 Aug 2016 01:01:56 +0000 (03:01 +0200)
Sonar/Plugins/sonar-custom-java-plugin/.pom.xml.swp [deleted file]
Sonar/Plugins/sonar-custom-java-plugin/pom.xml
Sonar/Plugins/sonar-custom-javascript-plugin/pom.xml [new file with mode: 0644]

diff --git a/Sonar/Plugins/sonar-custom-java-plugin/.pom.xml.swp b/Sonar/Plugins/sonar-custom-java-plugin/.pom.xml.swp
deleted file mode 100644 (file)
index 4c402d5..0000000
Binary files a/Sonar/Plugins/sonar-custom-java-plugin/.pom.xml.swp and /dev/null differ
index 8335378..ce3d988 100644 (file)
@@ -78,7 +78,7 @@
           <dependency>
       <groupId>org.sonarsource.java</groupId>
       <artifactId>java-frontend</artifactId>
-      <version>4.0</version>
+      <version>${java.plugin.version}</version>
     </dependency>
       
     
diff --git a/Sonar/Plugins/sonar-custom-javascript-plugin/pom.xml b/Sonar/Plugins/sonar-custom-javascript-plugin/pom.xml
new file mode 100644 (file)
index 0000000..7979169
--- /dev/null
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>de.example.plugins</groupId>
+        <artifactId>custom-sonar-plugins</artifactId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+
+  <artifactId>sonar-custom-javascript-plugin</artifactId>
+  <packaging>sonar-plugin</packaging>
+
+  <name>SonarQube custom JavaScript plugin</name>
+  <description>JavaScript plugin for SonarQube</description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <sonar.apiVersion>5.6.1</sonar.apiVersion>
+    <javascript.plugin.version>2.14</javascript.plugin.version>
+    <jdk.min.version>1.8</jdk.min.version>
+    <sonar.pluginKey>helloworld</sonar.pluginKey>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.sonarsource.sonarqube</groupId>
+      <artifactId>sonar-plugin-api</artifactId>
+      <version>${sonar.apiVersion}</version>
+      <scope>provided</scope>
+    </dependency>
+
+  <dependency>
+      <groupId>org.sonarsource.javascript</groupId>
+      <artifactId>sonar-javascript-plugin</artifactId>
+      <type>sonar-plugin</type>
+      <version>${javascript.plugin.version}</version>
+      <scope>provided</scope>
+  </dependency>
+      <dependency>
+        <groupId>com.google.code.gson</groupId>
+        <artifactId>gson</artifactId>
+        <version>2.6.2</version>
+        <scope>compile</scope>
+      </dependency>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>19.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.6</version>
+    </dependency>
+    <dependency>
+        <groupId>org.sonarsource.sslr-squid-bridge</groupId>
+        <artifactId>sslr-squid-bridge</artifactId>
+        <version>2.6.1</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.codehaus.sonar.sslr</groupId>
+            <artifactId>sslr-core</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.codehaus.sonar</groupId>
+            <artifactId>sonar-plugin-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.codehaus.sonar.sslr</groupId>
+            <artifactId>sslr-xpath</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+          <dependency>
+      <groupId>org.sonarsource.java</groupId>
+      <artifactId>javascript-frontend</artifactId>
+      <version>javascript.plugin.version</version>
+    </dependency>
+      
+    
+
+
+    <!-- unit tests -->
+    <dependency>
+      <groupId>org.sonarsource.sonarqube</groupId>
+      <artifactId>sonar-testing-harness</artifactId>
+      <version>${sonar.apiVersion}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.sonarsource.java</groupId>
+      <artifactId>java-checks-testkit</artifactId>
+      <version>${java.plugin.version}</version>
+      <scope>test</scope>
+    </dependency>
+       <dependency>
+               <groupId>org.easytesting</groupId>
+               <artifactId>fest-assert</artifactId>
+               <version>1.4</version>
+               <scope>test</scope>
+       </dependency>
+       <dependency>
+               <groupId>junit</groupId>
+               <artifactId>junit</artifactId>
+               <version>4.11</version>
+               <scope>test</scope>
+       </dependency>
+    <!--
+       1/3 Required dependency for log4j 2 with slf4j: binding between log4j 
+       2 and slf4j
+    -->
+       <dependency>
+               <groupId>org.apache.logging.log4j</groupId>
+               <artifactId>log4j-slf4j-impl</artifactId>
+               <version>2.6.1</version>
+               <scope>test</scope>
+       </dependency>
+    <!--
+        2/3 Required dependency for log4j 2 with slf4j: log4j 2 maven plugin 
+        (it is the log4j 2 implementation)
+    -->
+       <dependency>
+               <groupId>org.apache.logging.log4j</groupId>
+               <artifactId>log4j-core</artifactId>
+               <version>2.6.1</version>
+               <scope>test</scope>
+       </dependency>
+    <!--
+        3/3 Required dependency for getting rid of commons logging. This is 
+        the BRIDGE (no binding) between Jakarta Commons Logging (used by Spring) 
+        and whatever I am using for logging (in this case I am using log4j 2) See: 
+        http://www.slf4j.org/legacy.html We need exclusions in every dependency using 
+        Jakarta Commons Logging (see Spring dependencies below) 
+    -->
+       <dependency>
+               <groupId>org.slf4j</groupId>
+               <artifactId>jcl-over-slf4j</artifactId>
+               <version>1.7.21</version>
+               <scope>test</scope>
+       </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
+        <artifactId>sonar-packaging-maven-plugin</artifactId>
+        <version>1.17</version>
+        <extensions>true</extensions>
+        <configuration>
+          <pluginClass>de.example.plugins.helloworld.HelloWorldPlugin</pluginClass>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.5.1</version>
+        <configuration>
+          <source>${jdk.min.version}</source>
+          <target>${jdk.min.version}</target>
+          <encoding>${project.build.sourceEncoding}</encoding>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>