Skip to content

Commit

Permalink
Upgrade to JDK 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ledoyen committed Nov 17, 2024
1 parent 9938cc7 commit 23589eb
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 123 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/automerge-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Dependabot auto-merge

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
if: ${{ github.actor == 'dependabot[bot]' }}
uses: lernejo/reusable-workflows/.github/workflows/automerge-dependabot.yml@main
secrets: inherit
17 changes: 0 additions & 17 deletions .github/workflows/automerge.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/build.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build

on:
push:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
uses: lernejo/reusable-workflows/.github/workflows/ci.yml@main
secrets: inherit
with:
runs-on: ${{ matrix.os }}
30 changes: 0 additions & 30 deletions .github/workflows/generic-build.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/publish.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# Ignoring Maven wrapper to be downloaded
.mvn/wrapper/maven-wrapper.jar


# IntelliJ
.idea/
*.iml
Expand Down
2 changes: 2 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
57 changes: 32 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<kotlin.compiler.jvmTarget>21</kotlin.compiler.jvmTarget>

<kotlin.compiler.jvmTarget>16</kotlin.compiler.jvmTarget>
<kotlin.version>2.0.21</kotlin.version>

<slf4j.version>2.0.16</slf4j.version>
Expand Down Expand Up @@ -191,6 +191,8 @@
</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
Expand All @@ -211,16 +213,41 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<execution>
<id>add-source</id>
Expand Down Expand Up @@ -251,34 +278,17 @@
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
<args>
<arg>-Xjvm-default=all</arg>
</args>
</configuration>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<quiet>true</quiet>
</configuration>
Expand All @@ -294,7 +304,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -307,7 +316,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<goals>
Expand All @@ -334,4 +342,3 @@
</repository>
</distributionManagement>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -75,54 +75,44 @@ data class Rule private constructor(
)

@JvmStatic
@JvmOverloads
fun buildDependencyInversionRule() = Rule(
LooseCouplingRule::class.java,
"Dependency inversion principle not respected: type `{0}` should be replaced by its matching interface"
)

@JvmStatic
@JvmOverloads
fun buildUnusedLocalVariableRule() = Rule(
UnusedLocalVariableRule::class.java,
"Unused local variable: `{0}`"
)

@JvmStatic
@JvmOverloads
fun buildUnusedPrivateFieldRule() = Rule(
UnusedPrivateFieldRule::class.java,
"Unused private field: `{0}`"
)

@JvmStatic
@JvmOverloads
fun buildUnusedPrivateMethodRule() = Rule(
UnusedPrivateMethodRule::class.java,
"Unused private method: `{0}`"
)

@JvmStatic
@JvmOverloads
fun buildClassNamingConventionsRule() = Rule(
ClassNamingConventionsRule::class.java,
"Class name should follow UpperCamelCase convention, but `{1}` found instead"
)

@JvmStatic
@JvmOverloads
fun buildMethodNamingConventionsRule() = Rule(
MethodNamingConventionsRule::class.java,
"Method name should follow lowerCamelCase convention, but `{1}` found instead"
)

@JvmStatic
@JvmOverloads
fun buildEmptyControlStatementRule() = Rule(
EmptyControlStatementRule::class.java
)



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ internal fun parse(reportPath: Path): PmdReport? {
val jaxbContext: JAXBContext = JAXBContext.newInstance(InternalPmdReport::class.java)
val internalPmdReport =
jaxbContext.createUnmarshaller().unmarshal(fixedReportPath.toFile()) as InternalPmdReport
if (internalPmdReport.files != null) {
internalPmdReport.asPublicReport()
} else {
null
}
internalPmdReport.asPublicReport()
} catch ( // | FileNotFoundException | SAXException | ParserConfigurationException
e: JAXBException
) {
Expand Down

0 comments on commit 23589eb

Please sign in to comment.