Skip to content

Commit

Permalink
update build system, use java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
hgschmie committed Oct 21, 2023
1 parent 714bd26 commit a7251a4
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
test-java-version: [ 11, 17, 20 ]
test-java-version: [ 11, 17, 21 ]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +25,7 @@ jobs:
id: setup_build_jdk
name: Setup Build JDK
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
id: setup_build_jdk
name: Setup Build JDK
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
cache: maven
server-id: sonatype-nexus-snapshots
server-username: NEXUS_REPO_USER
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
cache: maven
server-id: github
server-password: SITE_DEPLOY
Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
50 changes: 35 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,54 @@
# 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.

SHELL = /bin/sh
.SUFFIXES:
.PHONY: help clean install test deploy deploy-site release

MAVEN = ./mvnw

default: help
export MAVEN_OPTS MAVEN_CONFIG

# must be the first target
default:: help

Makefile:: ;

clean:
clean::
${MAVEN} clean

install:
install::
${MAVEN} clean install

test:
test::
${MAVEN} surefire:test

deploy:
deploy::
${MAVEN} clean deploy

# run install b/c https://issues.apache.org/jira/browse/MJAVADOC-701
deploy-site:
deploy-site::
${MAVEN} clean install site-deploy

release:
release::
${MAVEN} clean release:clean release:prepare release:perform

help:
@echo " * clean - clean local build tree"
@echo " * install - installs build result in the local maven repository"
@echo " * deploy - installs build result in the snapshot OSS repository"
@echo " * test - run unit tests"
@echo " * deploy-site - builds and deploys the documentation site"
@echo " * release - release a new version to maven central"
release-site:: MAVEN_CONFIG += -Ppg-embedded-release
release-site:: deploy-site

help::
@echo " * clean - clean local build tree"
@echo " * install - installs build result in the local maven repository"
@echo " * test - run unit tests"
@echo " * deploy - installs build result in the snapshot OSS repository"
@echo " * deploy-site - builds and deploys the documentation site"
@echo " * release - release a new version to maven central"
@echo " * release-site - build the release version of the documentation site"
82 changes: 62 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.basepom</groupId>
<artifactId>basepom-oss</artifactId>
<version>53</version>
<groupId>org.kitei</groupId>
<artifactId>kitei-root</artifactId>
<version>13</version>
</parent>

<scm>
Expand Down Expand Up @@ -52,19 +52,19 @@
<basepom.javadoc.show>protected</basepom.javadoc.show>
<basepom.site.fail-javadoc>false</basepom.site.fail-javadoc>

<dep.plugin.inline.version>1.0.1</dep.plugin.inline.version>
<dep.plugin.inline.version>1.1.0</dep.plugin.inline.version>

<dep.slf4j.version>1.7.36</dep.slf4j.version>
<dep.guava.version>31.1-jre</dep.guava.version>
<dep.flyway.version>8.5.13</dep.flyway.version>
<dep.guava.version>32.1.3-jre</dep.guava.version>
<dep.flyway.version>9.22.3</dep.flyway.version>
<dep.postgresql-jdbc.version>42.6.0</dep.postgresql-jdbc.version>
<dep.junit5.version>5.9.3</dep.junit5.version>
<dep.auto-value.version>1.10.1</dep.auto-value.version>
<dep.junit5.version>5.10.0</dep.junit5.version>
<dep.auto-value.version>1.10.4</dep.auto-value.version>
<dep.maven-loader.version>2.1.0</dep.maven-loader.version>

<dep.apache-commons-compress.version>1.23.0</dep.apache-commons-compress.version>
<dep.apache-commons-compress.version>1.24.0</dep.apache-commons-compress.version>
<dep.xz.version>1.9</dep.xz.version>
<dep.checkerframework.version>3.34.0</dep.checkerframework.version>
<dep.checkerframework.version>3.39.0</dep.checkerframework.version>

<!-- MacOS Homebrew install location -->
<pg-embedded.test.local-dir>/usr/local</pg-embedded.test.local-dir>
Expand Down Expand Up @@ -259,7 +259,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<links>
<link>https://junit.org/junit5/docs/${dep.junit5.version}/api/</link>
<link>https://javadoc.io/doc/org.junit.jupiter/junit-jupiter-api/${dep.junit5.version}/</link>
<link>https://javadoc.io/doc/com.google.guava/guava/${dep.guava.version}/</link>
<link>https://javadoc.io/doc/com.github.spotbugs/spotbugs-annotations/${dep.spotbugs.version}</link>
</links>
Expand All @@ -273,13 +273,30 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries combine.children="append">
<Automatic-Module-Name>${project.moduleName}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
<executions>
<execution>
<id>default-jar</id>
<!-- add module name to main artifact -->
<configuration>
<archive>
<manifestEntries combine.children="append">
<Automatic-Module-Name>${project.moduleName}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
<execution>
<id>basepom.default</id>
<!-- add module name with "test" appended to tests artifact -->
<configuration>
<archive>
<manifestEntries combine.children="append">
<Automatic-Module-Name>${project.moduleName}.tests</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.basepom.maven</groupId>
Expand Down Expand Up @@ -339,6 +356,31 @@
</reporting>

<profiles>
<profile>
<id>java21</id>
<activation>
<jdk>[21,)</jdk>
</activation>
<properties>
<!-- see https://github.com/mockito/mockito/issues/3037 -->
<basepom.it.arguments>-XX:+EnableDynamicAgentLoading</basepom.it.arguments>
<basepom.test.arguments>-XX:+EnableDynamicAgentLoading</basepom.test.arguments>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- see https://inside.java/2023/07/29/quality-heads-up/ -->
<proc>full</proc>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>pg-embedded-release</id>
<properties>
Expand All @@ -351,14 +393,14 @@
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java17</id>
<id>enforce-java21</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[17,)</version>
<version>[21,)</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down

0 comments on commit a7251a4

Please sign in to comment.