Skip to content

Commit

Permalink
Adjust main pom file
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-strzelecki-vml committed Oct 21, 2024
1 parent 6a21159 commit de82537
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/actions/test-plugin-installation/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ inputs:
aem-rules-binary:
description: "Name of the JAR file to copy from Maven's 'target' directory into the plugins directory"
required: true
default: 'sonar-aemrules-plugin-1.8-SNAPSHOT.jar'
default: 'sonar-aemrules-plugin-1.7-SNAPSHOT.jar'
docker-hub-login:
description: 'Docker Hub username for which an access token has been generated'
required: true
Expand Down
196 changes: 128 additions & 68 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.vml.aemrules</groupId>
<artifactId>sonar-aemrules-plugin</artifactId>
<packaging>sonar-plugin</packaging>
<version>1.8-SNAPSHOT</version>
<version>1.7-SNAPSHOT</version>

<name>AEM Rules for SonarQube</name>
<description>SonarQube plugin with set of rules detecting possible bugs and bad smells specific for AEM
Expand Down Expand Up @@ -110,6 +110,7 @@
<sonar.java.plugin>8.5.0.37199</sonar.java.plugin>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.apiVersion>10.11.0.2468</sonar.apiVersion>
<sonar.apiImplVersion>10.6.0.92116</sonar.apiImplVersion>
<sonar.testingHarnessVersion>10.7.0.96327</sonar.testingHarnessVersion>
<jdk.min.version>17</jdk.min.version>
<sonar.sources>src/main/java,src/main/js</sonar.sources>
Expand All @@ -129,6 +130,16 @@
</repositories>

<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.sightly.compiler</artifactId>
<version>${htl.version}</version>
</dependency>
<!-- sonarsource version -->
<dependency>
<groupId>org.sonarsource.api.plugin</groupId>
Expand All @@ -137,9 +148,16 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.html</groupId>
<artifactId>sonar-html-plugin</artifactId>
<version>${sonar.html.version}</version>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api-impl</artifactId>
<version>${sonar.apiImplVersion}</version>
</dependency>
<dependency>
<groupId>org.sonarsource.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
<type>sonar-plugin</type>
<version>${sonar.java.plugin}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -175,37 +193,26 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.sonarsource.java</groupId>
<artifactId>sonar-java-plugin</artifactId>
<type>sonar-plugin</type>
<version>${sonar.java.plugin}</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
</dependency>
<dependency>
<groupId>org.sonarsource.html</groupId>
<artifactId>sonar-html-plugin</artifactId>
<version>${sonar.html.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.17.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.17.0</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.sightly.compiler</artifactId>
<version>${htl.version}</version>
</dependency>

<!-- TODO: Check if versions are valid with target AEM version-->
<!-- unit tests -->
Expand All @@ -215,46 +222,16 @@
<version>${sonar.testingHarnessVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.26.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.0-jre</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api-impl</artifactId>
<version>10.6.0.92116</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -264,9 +241,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.analyzer-commons</groupId>
<artifactId>sonar-analyzer-commons</artifactId>
<version>2.14.0.3087</version>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -325,6 +302,12 @@
<version>4.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
Expand All @@ -343,10 +326,36 @@
<version>1.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.0-jre</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.analyzer-commons</groupId>
<artifactId>sonar-analyzer-commons</artifactId>
<version>2.14.0.3087</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>17</release>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
Expand All @@ -357,7 +366,6 @@
<pluginDescription>${project.description}</pluginDescription>
<pluginKey>aemrules</pluginKey>
<pluginClass>com.vml.aemrules.AemRulesSonarPlugin</pluginClass>
<!-- Optional, only if you are sure to support older versions of the plugin API than the one you are compiling against -->
<pluginApiMinVersion>9.9</pluginApiMinVersion>
<pluginIssueTrackerUrl>https://github.com/wttech/AEM-Rules-for-SonarQube/issues
</pluginIssueTrackerUrl>
Expand All @@ -367,14 +375,6 @@
<sonarLintSupported>false</sonarLintSupported>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
Expand Down Expand Up @@ -434,6 +434,66 @@
<repoToken>${coveralls.repo.token}</repoToken>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<skipExistingHeaders>false</skipExistingHeaders>
<header>${basedir}/assets/license-template.txt</header>
<headerDefinitions>
<header>${basedir}/assets/license-header-definition.xml</header>
</headerDefinitions>
<excludes>
<exclude>**/README</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>**/LICENSE.txt</exclude>
<exclude>**.xml</exclude>
<exclude>assets/**</exclude>
<exclude>src/test/resources/htl/HtlCommentsCheck.html</exclude>
<exclude>src/main/js/**</exclude>
<exclude>conf/**</exclude>
<exclude>scripts/**</exclude>
<exclude>.cirrus.yml</exclude>
<exclude>**.yml</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
Maven dependency plugin is necessary for JavaCheckVerifier.verifyNoIssue to work properly. It copies
dependencies other than "provided" to test-jars folder.
Warning! If you remove it, tests which call JavaCheckVerifier.verifyNoIssue will
always pass, even if they are incorrect.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>test-compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<excludeScope>provided</excludeScope>
<outputDirectory>${project.build.directory}/test-jars</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
21 changes: 21 additions & 0 deletions src/test/resources/htl/Empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
#%L
AEM Rules for SonarQube
%%
Copyright (C) 2015-2024 VML
%%
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#L%
-->

0 comments on commit de82537

Please sign in to comment.