Skip to content

Commit

Permalink
setup java version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ozlerhakan committed Nov 24, 2024
1 parent 835db2d commit 3edc875
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 43 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Poiji Build
name: Poiji Build and Test
on: [push, pull_request]
jobs:
build:
test:
strategy:
matrix:
java: [ 11, 17, 23 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
cache: maven
- name: Build and Test with Maven
java-version: ${{ matrix.java }}
distribution: adopt
- name: Build and Test project
run: mvn clean -B package --file pom.xml -P coverage
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
Expand Down
42 changes: 8 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?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/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.github.ozlerhakan</groupId>
Expand Down Expand Up @@ -51,10 +52,9 @@

<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<jdk.source>11</jdk.source>
<jdk.target>11</jdk.target>

<maven.version>3.0.4</maven.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -94,10 +94,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.13.0</version>
<configuration>
<source>${jdk.source}</source>
<target>${jdk.target}</target>
<release>11</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -172,39 +171,14 @@
</gpgArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<!--Enforce maven version-->
<requireMavenVersion>
<version>${maven.version}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${jdk.source}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>javadoclint</id>
<activation>
<jdk>[1.8)</jdk>
<jdk>[11,)</jdk>
</activation>
<properties>
<javadoc.none>-Xdoclint:none</javadoc.none>
Expand Down

0 comments on commit 3edc875

Please sign in to comment.