Skip to content

Commit

Permalink
Changed Java application archetype to use Java 17
Browse files Browse the repository at this point in the history
It's been the LTS for a while now.
  • Loading branch information
freemanjp committed Oct 5, 2022
1 parent 8a7b8ee commit 6378cea
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*.xml text
*.yaml text
*.yml text
jvm.config text
LICENSE text
lombok.config text

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Build with Maven
run: .github/scripts/build.sh

Expand All @@ -35,7 +35,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Build with Maven
run: |-
export GIT_TAG="${GITHUB_REF#refs/tags/}"
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Configure Git user
run: >-
git config --global user.name 'John Freeman' &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Build with Maven
run: .github/scripts/build.sh
10 changes: 10 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<include>.editorconfig</include>
<include>.gitattributes</include>
<include>.gitignore</include>
<include>.mvn/jvm.config</include>
<include>lombok.config</include>
</includes>
</fileSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*.xml text
*.yaml text
*.yml text
jvm.config text
LICENSE text
lombok.config text

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $h1 ${projectName}

$h2 Requirements

* Java 11
* Java 17
* Direct internet access / Apache Maven proxy configured

$h2 Building
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<jacoco.file.minimum-coverage-ratio>0.75</jacoco.file.minimum-coverage-ratio>
<jacoco.skip>false</jacoco.skip>

<java.require.version>[11,12)</java.require.version>
<java.target.version>11</java.target.version>
<java.require.version>[17,18)</java.require.version>
<java.target.version>17</java.target.version>

<!-- Check dependencies are used, declared and have the correct scope -->
<mdep.analyze.skip>false</mdep.analyze.skip>
Expand Down Expand Up @@ -70,6 +70,15 @@

<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>gcr.io/distroless/java${dollar}{java.target.version}-debian11:nonroot</image>
</from>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ archetype. The GantSign Maven Archetype provides the following:
Requirements
------------

* Java 11
* Java 17
* Maven >= 3.5

Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<include>.editorconfig</include>
<include>.gitattributes</include>
<include>.gitignore</include>
<include>.mvn/jvm.config</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*.xml text
*.yaml text
*.yml text
jvm.config text
LICENSE text

# Declare files that will always have CRLF line endings on checkout.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*.xml text
*.yaml text
*.yml text
jvm.config text
LICENSE text

# Declare files that will always have CRLF line endings on checkout.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<checkstyle.config-name>GantSign</checkstyle.config-name>
<dollar>$</dollar>
<gantsign-parent.version>3.3.0</gantsign-parent.version>
<java.require.version>[11,12)</java.require.version>
<java.target.version>11</java.target.version>
<java.require.version>[17,18)</java.require.version>
<java.target.version>17</java.target.version>
<maven-archetype-plugin.version>3.2.1</maven-archetype-plugin.version>
</properties>

Expand Down

0 comments on commit 6378cea

Please sign in to comment.