Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies, SpotBugs, PMD, CheckStyle #480

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ public void testOuterClasWithNoJavaDoc() throws Exception {
* an error is expected at the line where the outer class is declared
* in the file
*/
int warningLine = 1;
// since https://github.com/checkstyle/checkstyle/issues/11584 there is no warning
// if no javadoc is present
boolean checkInnerClasses = false;
checkFileForAuthorTags(checkInnerClasses, fileName, warningLine);
checkFileForAuthorTags(checkInnerClasses, fileName);
}

@Test
Expand All @@ -77,10 +78,10 @@ public void testOuterAndInnerClassesWithNoJavaDoc() throws Exception {
* errors are expected at the lines where the classes are declared in
* the file
*/
int firstWarningLine = 1;
int secondWarningLine = 3;
// since https://github.com/checkstyle/checkstyle/issues/11584 there is no warning
// if no javadoc is present
boolean checkInnerClasses = true;
checkFileForAuthorTags(checkInnerClasses, fileName, firstWarningLine, secondWarningLine);
checkFileForAuthorTags(checkInnerClasses, fileName);
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions docs/maven-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Parameters:
| ------ | ------| -------- |
| **checkstyleRuleset** | String | Relative path of the XML configuration to use. If not set the default ruleset file will be used |
| **checkstyleFilter** | String | Relative path of the suppressions XML file to use. If not set the default filter file will be used |
| **maven.checkstyle.version** | String | The version of the maven-checkstyle-plugin that will be used (default value is **3.4.0**)|
| **maven.checkstyle.version** | String | The version of the maven-checkstyle-plugin that will be used (default value is **3.6.0**)|
| **checkstylePlugins** | List<Dependency> | A list with artifacts that contain additional checks for Checkstyle |
| **checkstyleProperties** | String | Relative path of the properties file to use in the ruleset to configure specific checks |

Expand All @@ -117,7 +117,7 @@ Parameters:
| **spotbugsRuleset** | String | Relative path to the XML that specifies the bug detectors which should be run. If not set the default file will be used|
| **spotbugsInclude** | String | Relative path to the XML that specifies the bug instances that will be included in the report. If not set the default file will be used|
| **spotbugsExclude** | String | Relative path to the XML that specifies the bug instances that will be excluded from the report. If not set the default file will be used|
| **maven.spotbugs.version** | String | The version of the spotbugs-maven-plugin that will be used (default value is **4.8.6.2**) |
| **maven.spotbugs.version** | String | The version of the spotbugs-maven-plugin that will be used (default value is **4.8.6.6**) |
| **spotbugs.version** | String | The version of SpotBugs that will be used (default value is **4.8.6**) |
| **spotbugsPlugins** | List<Dependency> | A list with artifacts that contain additional detectors/patterns for SpotBugs |
| **findbugs.slf4j.version** | String | The version of the findbugs-slf4j plugin that will be used (default value is **1.5.0**)|
Expand Down
32 changes: 17 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@
<maven.compiler.target>${oh.java.version}</maven.compiler.target>
<maven.compiler.compilerVersion>${oh.java.version}</maven.compiler.compilerVersion>
<maven.eclipse.version>2.10</maven.eclipse.version>
<junit.version>5.9.1</junit.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.lang3.version>3.12.0</commons.lang3.version>
<junit.version>5.11.4</junit.version>
<commons.io.version>2.18.0</commons.io.version>
<commons.lang3.version>3.17.0</commons.lang3.version>
<mockito.version>4.10.0</mockito.version>
<maven.resources.version>3.3.1</maven.resources.version>
<pmd.version>7.8.0</pmd.version>
<checkstyle.version>10.17.0</checkstyle.version>
<pmd.version>7.9.0</pmd.version>
<checkstyle.version>10.21.1</checkstyle.version>
<spotbugs.version>4.8.6</spotbugs.version>
<maven.core.version>3.6.0</maven.core.version>
<maven.plugin.api.version>3.8.5</maven.plugin.api.version>
<maven.plugin.annotations.version>3.7.0</maven.plugin.annotations.version>
<maven.core.version>3.9.9</maven.core.version>
<maven.plugin.api.version>3.9.9</maven.plugin.api.version>
<maven.plugin.annotations.version>3.15.1</maven.plugin.annotations.version>
<maven.plugin.plugin.version>3.8.2</maven.plugin.plugin.version>
<maven.plugin.compiler.version>3.13.0</maven.plugin.compiler.version>
<mojo.executor.version>2.4.0</mojo.executor.version>
<org.jsoup.version>1.7.1</org.jsoup.version>
<mojo.executor.version>2.4.1</mojo.executor.version>
<org.jsoup.version>1.18.3</org.jsoup.version>
<sat.version>0.17.0</sat.version>
<jdt-annotations.version>2.1.0</jdt-annotations.version>
<flexmark.version>0.64.0</flexmark.version>
<jdt-annotations.version>2.3.100</jdt-annotations.version>
<flexmark.version>0.64.8</flexmark.version>
<maven.surefire.plugin.version>3.5.2</maven.surefire.plugin.version>
<jetty.server.version>9.4.50.v20221201</jetty.server.version>
<saxon.version>9.1.0.8</saxon.version>
Expand All @@ -87,7 +87,7 @@
<spotless.eclipse.version>4.25</spotless.eclipse.version>
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
<slf4j.version>1.7.36</slf4j.version>
<logback.version>1.2.9</logback.version>
<logback.version>1.2.13</logback.version>
<eea.version>2.4.0</eea.version>
<m2e.jdt.annotationpath>target/dependency</m2e.jdt.annotationpath>
</properties>
Expand Down Expand Up @@ -130,7 +130,7 @@
<!-- Required for Checkstyle tests -->
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.1.3</version>
<version>1.4.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -429,12 +429,14 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<!-- cannot go beyond 2.12.1 as long as Java11 is in use -->
<version>2.12.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.30.0</version>
<!-- cannot go beyond 3.33.0 as long as Java11 is in use -->
<version>3.33.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class CheckstyleChecker extends AbstractChecker {
/**
* The version of the maven-checkstyle-plugin that will be used
*/
@Parameter(property = "maven.checkstyle.version", defaultValue = "3.4.0")
@Parameter(property = "maven.checkstyle.version", defaultValue = "3.6.0")
private String checkstyleMavenVersion;

/**
Expand Down Expand Up @@ -118,7 +118,7 @@ public void execute() throws MojoExecutionException {

checkstylePlugins.add(dependency("org.openhab.tools.sat.custom-checks", "checkstyle", plugin.getVersion()));
// Maven may load an older version, if no version is specified
checkstylePlugins.add(dependency("com.puppycrawl.tools", "checkstyle", "10.17.0"));
checkstylePlugins.add(dependency("com.puppycrawl.tools", "checkstyle", "10.21.1"));
checkstylePlugins.forEach(logDependency());

String baseDir = mavenProject.getBasedir().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class PmdChecker extends AbstractChecker {
@Parameter
private List<Dependency> pmdPlugins = new ArrayList<>();

private static final String PMD_VERSION = "7.8.0";
private static final String PMD_VERSION = "7.9.0";
/**
* Location of the properties files that contains configuration options for the maven-pmd-plugin
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class SpotBugsChecker extends AbstractChecker {
/**
* The version of the spotbugs-maven-plugin that will be used
*/
@Parameter(property = "maven.spotbugs.version", defaultValue = "4.8.6.2")
@Parameter(property = "maven.spotbugs.version", defaultValue = "4.8.6.6")
private String spotbugsMavenPluginVersion;

/**
Expand Down