Upgrade to Java 21 (#693)

upgrade-eclipse-formatter
Michael Barry 2023-10-26 06:30:45 -04:00 zatwierdzone przez GitHub
rodzic b23d7ea7f5
commit b108f88453
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
15 zmienionych plików z 217 dodań i 188 usunięć

Wyświetl plik

@ -18,10 +18,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
- name: Ensure code formatted with mvn spotless:apply - name: Ensure code formatted with mvn spotless:apply
@ -34,13 +34,14 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ] os: [ ubuntu-latest, macos-latest, windows-latest ]
jdk: [ 17 ] jdk: [ 21 ]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
jdk: 17 jdk: 21
args: "-DargLine='-Duser.language=fr -Duser.country=FR'" args: "-DargLine='-Duser.language=fr -Duser.country=FR'"
- os: ubuntu-latest - os: ubuntu-latest
jdk: 20 jdk: 21
args: ""
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
@ -71,10 +72,10 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
- name: Build and test - name: Build and test
run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml run: mvn --batch-mode -no-transfer-progress package --file standalone.pom.xml
@ -102,7 +103,7 @@ jobs:
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
@ -139,7 +140,7 @@ jobs:
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'

Wyświetl plik

@ -44,7 +44,7 @@ jobs:
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4

Wyświetl plik

@ -18,65 +18,65 @@ jobs:
contents: write contents: write
packages: write packages: write
steps: steps:
- name: Ensure version does not start with 'v' - name: Ensure version does not start with 'v'
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
script: | script: |
version = context.payload.inputs.version; version = context.payload.inputs.version;
if (/^v/.test(version)) throw new Error("Bad version number: " + version) if (/^v/.test(version)) throw new Error("Bad version number: " + version)
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Cache data/sources - name: Cache data/sources
uses: ./.github/cache-sources-action uses: ./.github/cache-sources-action
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3
with: with:
java-version: '17' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
server-id: ossrh server-id: ossrh
server-username: MAVEN_USERNAME server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD server-password: MAVEN_PASSWORD
- name: Check tag does not exist yet - name: Check tag does not exist yet
run: if git rev-list "v${{ github.event.inputs.version }}"; then echo "Tag already exists. Aborting the release process."; exit 1; fi run: if git rev-list "v${{ github.event.inputs.version }}"; then echo "Tag already exists. Aborting the release process."; exit 1; fi
- run: ./scripts/set-versions.sh "${{ github.event.inputs.version }}" - run: ./scripts/set-versions.sh "${{ github.event.inputs.version }}"
- run: ./scripts/build-release.sh - run: ./scripts/build-release.sh
- run: ./scripts/test-release.sh "${{ github.event.inputs.version }}" - run: ./scripts/test-release.sh "${{ github.event.inputs.version }}"
- name: Create tag - name: Create tag
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
script: | script: |
github.rest.git.createRef({ github.rest.git.createRef({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
ref: "refs/tags/v${{ github.event.inputs.version }}", ref: "refs/tags/v${{ github.event.inputs.version }}",
sha: context.sha sha: context.sha
}) })
- run: mv planetiler-dist/target/*with-deps.jar planetiler.jar - run: mv planetiler-dist/target/*with-deps.jar planetiler.jar
- run: sha256sum planetiler.jar > planetiler.jar.sha256 - run: sha256sum planetiler.jar > planetiler.jar.sha256
- run: md5sum planetiler.jar > planetiler.jar.md5 - run: md5sum planetiler.jar > planetiler.jar.md5
- name: Install GPG Private Key - name: Install GPG Private Key
run: | run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
fail_on_unmatched_files: true fail_on_unmatched_files: true
tag_name: v${{ github.event.inputs.version }} tag_name: v${{ github.event.inputs.version }}
draft: true draft: true
files: | files: |
planetiler.jar* planetiler.jar*
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./scripts/push-release.sh ${{ github.event.inputs.version }} - run: ./scripts/push-release.sh ${{ github.event.inputs.version }}
env: env:
GITHUB_ACTOR: ${{ github.actor }} GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAGS: ${{ github.event.inputs.image_tags }} IMAGE_TAGS: ${{ github.event.inputs.image_tags }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

Wyświetl plik

@ -21,37 +21,37 @@ jobs:
contents: read contents: read
packages: write packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Cache data/sources - name: Cache data/sources
uses: ./.github/cache-sources-action uses: ./.github/cache-sources-action
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
server-id: ossrh server-id: ossrh
server-username: MAVEN_USERNAME server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD server-password: MAVEN_PASSWORD
- run: ./scripts/build-release.sh - run: ./scripts/build-release.sh
- run: ./scripts/test-release.sh - run: ./scripts/test-release.sh
- run: sha256sum planetiler-dist/target/*with-deps.jar - run: sha256sum planetiler-dist/target/*with-deps.jar
- run: md5sum planetiler-dist/target/*with-deps.jar - run: md5sum planetiler-dist/target/*with-deps.jar
- name: 'Upload artifact' - name: 'Upload artifact'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: planetiler-build name: planetiler-build
path: planetiler-dist/target/*with-deps.jar path: planetiler-dist/target/*with-deps.jar
- name: Install GPG Private Key - name: Install GPG Private Key
run: | run: |
echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import echo -n "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
- run: ./scripts/push-release.sh - run: ./scripts/push-release.sh
env: env:
GITHUB_ACTOR: ${{ github.actor }} GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAGS: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tags || 'latest,snapshot' }} IMAGE_TAGS: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tags || 'latest,snapshot' }}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

Wyświetl plik

@ -15,66 +15,66 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
# Disabling shallow clone is recommended for improving relevancy of reporting # Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0 fetch-depth: 0
submodules: true submodules: true
- name: Set up JDK 17 - name: Set up JDK 21
uses: actions/setup-java@v3 uses: actions/setup-java@v3
with: with:
java-version: 17 java-version: 21
distribution: 'temurin' distribution: 'temurin'
cache: 'maven' cache: 'maven'
- name: Cache SonarCloud packages - name: Cache SonarCloud packages
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.sonar/cache path: ~/.sonar/cache
key: ${{ runner.os }}-sonar key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar
- name: Analyze with SonarCloud - name: Analyze with SonarCloud
run: | run: |
mvn -Dspotless.check.skip -Pcoverage -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar mvn -Dspotless.check.skip -Pcoverage -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
env: env:
# Needed to get some information about the pull request, if any # Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Read-only user, use this token to link SonarLint to SonarCloud as well # Read-only user, use this token to link SonarLint to SonarCloud as well
SONAR_TOKEN: c2cfe8bd7368ced07e84a620b7c2487846e220eb SONAR_TOKEN: c2cfe8bd7368ced07e84a620b7c2487846e220eb
- name: Wait for SonarCloud API to update... - name: Wait for SonarCloud API to update...
run: "sleep 10" run: "sleep 10"
- name: Upload annotations on PRs - name: Upload annotations on PRs
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
script: | script: |
const pr = context.payload.pull_request.number; const pr = context.payload.pull_request.number;
const url = `https://sonarcloud.io/api/issues/search?pullRequest=${pr}&s=FILE_LINE&resolved=false&sinceLeakPeriod=true&ps=100&facets=severities%2Ctypes&componentKeys=onthegomap_planetiler&organization=onthegomap&additionalFields=_all`; const url = `https://sonarcloud.io/api/issues/search?pullRequest=${pr}&s=FILE_LINE&resolved=false&sinceLeakPeriod=true&ps=100&facets=severities%2Ctypes&componentKeys=onthegomap_planetiler&organization=onthegomap&additionalFields=_all`;
console.log("Fetching " + url); console.log("Fetching " + url);
const response = await github.request(url); const response = await github.request(url);
console.log("Got " + JSON.stringify(response.data)); console.log("Got " + JSON.stringify(response.data));
response.data.issues.forEach(issue => { response.data.issues.forEach(issue => {
try { try {
if (issue.severity === 'INFO') return; if (issue.severity === 'INFO') return;
const textRange = issue.textRange; const textRange = issue.textRange;
const rule = encodeURIComponent(issue.rule); const rule = encodeURIComponent(issue.rule);
const message = [ const message = [
issue.message, issue.message,
'', '',
`rule: ${issue.rule} (https://sonarcloud.io/organizations/onthegomap/rules?open=${rule}&rule_key=${rule})`, `rule: ${issue.rule} (https://sonarcloud.io/organizations/onthegomap/rules?open=${rule}&rule_key=${rule})`,
`issue url: https://sonarcloud.io/project/issues?pullRequest=${pr}&open=${encodeURIComponent(issue.key)}&id=onthegomap_planetiler` `issue url: https://sonarcloud.io/project/issues?pullRequest=${pr}&open=${encodeURIComponent(issue.key)}&id=onthegomap_planetiler`
].join('\n'); ].join('\n');
const args = { const args = {
title: `${issue.severity} ${issue.type}`, title: `${issue.severity} ${issue.type}`,
file: issue.component.replace(/^[^:]*:/, ''), file: issue.component.replace(/^[^:]*:/, ''),
startLine: textRange.startLine, startLine: textRange.startLine,
endLine: textRange.endLine, endLine: textRange.endLine,
startColumn: textRange.startOffset, startColumn: textRange.startOffset,
endColumn: textRange.endOffset endColumn: textRange.endOffset
}; };
core.warning(message, args); core.warning(message, args);
console.log(args); console.log(args);
} catch (e) { } catch (e) {
core.error(`Unable to parse sonar issue: ${JSON.stringify(issue)}`); core.error(`Unable to parse sonar issue: ${JSON.stringify(issue)}`);
} }
}); });

Wyświetl plik

@ -11,12 +11,12 @@ Pull requests are welcome! Any pull request should:
To set up your local development environment: To set up your local development environment:
- Fork the repo [setup submodules](README.md#git-submodules) - Fork the repo [setup submodules](README.md#git-submodules)
- Install Java 17 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or - Install Java 21 or later. You can download Java manually from [Adoptium](https://adoptium.net/installation.html) or
use: use:
- [Windows installer](https://adoptium.net/installation.html#windows-msi) - [Windows installer](https://adoptium.net/installation.html#windows-msi)
- [macOS installer](https://adoptium.net/installation.html#macos-pkg) (or `brew install --cask temurin`, - [macOS installer](https://adoptium.net/installation.html#macos-pkg) (or `brew install --cask temurin`,
or `port install openjdk17-temurin`) or `port install openjdk21-temurin`)
- [Linux installer](https://adoptium.net/installation/linux/) (or `apt-get install openjdk-17-jdk`) - [Linux installer](https://adoptium.net/installation/linux/) (or `apt-get install openjdk-21-jdk`)
- Build and run the tests ([mvnw](https://github.com/takari/maven-wrapper) automatically downloads maven the first time - Build and run the tests ([mvnw](https://github.com/takari/maven-wrapper) automatically downloads maven the first time
you run it): you run it):
- on mac/linux: `./mvnw clean test` - on mac/linux: `./mvnw clean test`
@ -54,7 +54,7 @@ Troubleshooting:
- If any java source files show "Cannot resolve symbol..." errors for Planetiler classes, you might need to - If any java source files show "Cannot resolve symbol..." errors for Planetiler classes, you might need to
select: `File -> Invalidate Caches... -> Just Restart`. select: `File -> Invalidate Caches... -> Just Restart`.
- If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 17 or later - If you see a "Project JDK is not defined" error, then choose `Setup SDK` and point IntelliJ at the Java 21 or later
installed on your system installed on your system
### Visual Studio Code ### Visual Studio Code

Wyświetl plik

@ -3,9 +3,9 @@
To generate a map of the world using the To generate a map of the world using the
built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a built-in [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), you will need a
machine with machine with
Java 17 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf` Java 21 or later installed and at least 10x as much disk space and at least 0.5x as much RAM as the `planet.osm.pbf`
file you start from. All testing has been done using Digital Ocean droplets with dedicated file you start from. All testing has been done using Digital Ocean droplets with dedicated
vCPUs ([referral link](https://m.do.co/c/a947e99aab25)) and OpenJDK 17 installed through `apt`. Planetiler splits work vCPUs ([referral link](https://m.do.co/c/a947e99aab25)) and OpenJDK 21 installed through `apt`. Planetiler splits work
among available CPUs so the more you have, the less time it takes. among available CPUs so the more you have, the less time it takes.
### 1) Choose the Data Source ### 1) Choose the Data Source
@ -84,10 +84,10 @@ To generate the tiles shown on https://onthegomap.github.io/planetiler-demo/ I u
S3 snapshot, then ran Planetiler on a Digital Ocean Memory-Optimized droplet with 16 CPUs, 128GB RAM, and 1.17TB disk S3 snapshot, then ran Planetiler on a Digital Ocean Memory-Optimized droplet with 16 CPUs, 128GB RAM, and 1.17TB disk
running Ubuntu 21.04 x64 in the nyc3 location. running Ubuntu 21.04 x64 in the nyc3 location.
First, I installed java 17 jre and screen: First, I installed java 21 jre and screen:
```bash ```bash
apt-get update && apt-get install -y openjdk-17-jre-headless screen apt-get update && apt-get install -y openjdk-21-jre-headless screen
``` ```
Then I added a script `runworld.sh` to run with 100GB of RAM: Then I added a script `runworld.sh` to run with 100GB of RAM:

Wyświetl plik

@ -33,7 +33,7 @@ the [OpenStreetMap Americana Project](https://github.com/ZeLonewolf/openstreetma
To generate a map of an area using the [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles), To generate a map of an area using the [OpenMapTiles profile](https://github.com/openmaptiles/planetiler-openmaptiles),
you will need: you will need:
- Java 17+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/) - Java 21+ (see [CONTRIBUTING.md](CONTRIBUTING.md)) or [Docker](https://docs.docker.com/get-docker/)
- at least 1GB of free disk space plus 5-10x the size of the `.osm.pbf` file - at least 1GB of free disk space plus 5-10x the size of the `.osm.pbf` file
- at least 0.5x as much free RAM as the input `.osm.pbf` file size - at least 0.5x as much free RAM as the input `.osm.pbf` file size

Wyświetl plik

@ -292,15 +292,18 @@ Specific tile post processing operations for merging features may be defined:
- `merge_line_strings` - Combines linestrings with the same set of attributes into a multilinestring where segments with - `merge_line_strings` - Combines linestrings with the same set of attributes into a multilinestring where segments with
touching endpoints are merged. touching endpoints are merged.
- `merge_polygons` - Combines polygons with the same set of attributes into a multipolygon where overlapping/touching polygons - `merge_polygons` - Combines polygons with the same set of attributes into a multipolygon where overlapping/touching
polygons
are combined into fewer polygons covering the same area. are combined into fewer polygons covering the same area.
The follow attributes for `merge_line_strings` may be set: The follow attributes for `merge_line_strings` may be set:
- `min_length` - Minimum tile pixel length of features to emit, or 0 to emit all merged linestrings. - `min_length` - Minimum tile pixel length of features to emit, or 0 to emit all merged linestrings.
- `tolerance` - After merging, simplify linestrings using this pixel tolerance, or -1 to skip simplification step. - `tolerance` - After merging, simplify linestrings using this pixel tolerance, or -1 to skip simplification step.
- `buffer` - Number of pixels outside the visible tile area to include detail for, or -1 to skip clipping step. - `buffer` - Number of pixels outside the visible tile area to include detail for, or -1 to skip clipping step.
The follow attribute for `merge_polygons` may be set: The follow attribute for `merge_polygons` may be set:
- `min_area` - Minimum area in square tile pixels of polygons to emit. - `min_area` - Minimum area in square tile pixels of polygons to emit.
For example: For example:
@ -534,7 +537,7 @@ in [PlanetilerStdLib](src/main/java/com/onthegomap/planetiler/custommap/expressi
- `<string>.replace(from, to, limit)` returns the input string with the first N occurrences of from replaced by to - `<string>.replace(from, to, limit)` returns the input string with the first N occurrences of from replaced by to
- `<string>.replaceRegex(pattern, value)` replaces every occurrence of regular expression with value from the string - `<string>.replaceRegex(pattern, value)` replaces every occurrence of regular expression with value from the string
it was called on using java's it was called on using java's
built-in [replaceAll](<https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.lang.String)>) built-in [replaceAll](<https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.lang.String)>)
behavior behavior
- `<string>.split(separator)` returns a list of strings split from the input by a separator - `<string>.split(separator)` returns a list of strings split from the input by a separator
- `<string>.split(separator, limit)` splits the list into up to N parts - `<string>.split(separator, limit)` splits the list into up to N parts

Wyświetl plik

@ -14,6 +14,12 @@
<properties> <properties>
<mainClass>com.onthegomap.planetiler.Main</mainClass> <mainClass>com.onthegomap.planetiler.Main</mainClass>
<!--
compile against an earlier version so that Main runs but can emit a more readable
error when running on an older version of Java
-->
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<image.version>${project.version}</image.version> <image.version>${project.version}</image.version>
<image>ghcr.io/onthegomap/planetiler:${image.version}</image> <image>ghcr.io/onthegomap/planetiler:${image.version}</image>
<assembly-phase>package</assembly-phase> <assembly-phase>package</assembly-phase>
@ -54,7 +60,7 @@
<skip>false</skip> <skip>false</skip>
<from> <from>
<image> <image>
eclipse-temurin:17-jre eclipse-temurin:21-jre
</image> </image>
<platforms> <platforms>
<platform> <platform>

Wyświetl plik

@ -25,6 +25,15 @@ import org.openmaptiles.util.VerifyMonaco;
* public static void main(String[] args)} methods of runnable classes. * public static void main(String[] args)} methods of runnable classes.
*/ */
public class Main { public class Main {
static {
int version = Runtime.version().feature();
if (version < 21) {
System.err.println(
"You are using Java " + version +
" but Planetiler requires 21 or later, for more details on upgrading see: https://github.com/onthegomap/planetiler/blob/main/CONTRIBUTING.md");
System.exit(1);
}
}
private static final EntryPoint DEFAULT_TASK = OpenMapTilesMain::main; private static final EntryPoint DEFAULT_TASK = OpenMapTilesMain::main;
private static final Map<String, EntryPoint> ENTRY_POINTS = Map.ofEntries( private static final Map<String, EntryPoint> ENTRY_POINTS = Map.ofEntries(

Wyświetl plik

@ -4,7 +4,7 @@ This is a minimal example project that shows how to create custom maps with Plan
Requirements: Requirements:
- Java 17+ (see [CONTIRBUTING.md](../CONTRIBUTING.md)) - Java 21+ (see [CONTIRBUTING.md](../CONTRIBUTING.md))
- on mac: `brew install --cask temurin` - on mac: `brew install --cask temurin`
- [Maven](https://maven.apache.org/install.html) - [Maven](https://maven.apache.org/install.html)
- on mac: `brew install maven` - on mac: `brew install maven`

Wyświetl plik

@ -9,8 +9,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<planetiler.version>0.7-SNAPSHOT</planetiler.version> <planetiler.version>0.7-SNAPSHOT</planetiler.version>
<junit.version>5.10.0</junit.version> <junit.version>5.10.0</junit.version>
<!-- Replace this with the main class for the profile you add --> <!-- Replace this with the main class for the profile you add -->

@ -1 +1 @@
Subproject commit d4aaae894b02e6feb5d1ae042bf31c1bcfa73c49 Subproject commit 7dbbc5089e8ca5607d9c3ecf1991d35b1de5c6cf

20
pom.xml
Wyświetl plik

@ -17,8 +17,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<maven.source.excludeResources>true</maven.source.excludeResources> <maven.source.excludeResources>true</maven.source.excludeResources>
<jackson.version>2.15.3</jackson.version> <jackson.version>2.15.3</jackson.version>
<junit.version>5.10.0</junit.version> <junit.version>5.10.0</junit.version>
@ -203,7 +203,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- require building with jdk 17 --> <!-- require building with jdk 21 -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
@ -217,7 +217,7 @@
<configuration> <configuration>
<rules> <rules>
<requireJavaVersion> <requireJavaVersion>
<version>17</version> <version>21</version>
</requireJavaVersion> </requireJavaVersion>
</rules> </rules>
</configuration> </configuration>
@ -245,8 +245,18 @@
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version> <version>3.1.1</version>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<compilerArgs>
<arg>-proc:full</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins> </plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>