From 3680df633db26c1316ff2cc5e6a8178ccd31a18c Mon Sep 17 00:00:00 2001
From: Michael Barry
Date: Thu, 23 May 2024 06:03:21 -0400
Subject: [PATCH] Attach sources to fat jar to improve no-build IDE experience
(#892)
---
.github/workflows/maven.yml | 4 +-
planetiler-core/pom.xml | 2 +-
.../util/SeekableInMemoryByteChannel.java | 3 +-
planetiler-dist/pom.xml | 13 ++++++
pom.xml | 45 +++++++------------
5 files changed, 34 insertions(+), 33 deletions(-)
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index a4158207..82390214 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -57,10 +57,10 @@ jobs:
# Skip spotless since that gets checked in a separate task
- name: Build with mvnw (linux/mac)
if: ${{ !contains(matrix.os, 'windows') }}
- run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
+ run: ./mvnw ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress verify jib:buildTar --file pom.xml
- name: Build with mvnw.cmd (windows)
if: ${{ contains(matrix.os, 'windows') }}
- run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress package verify jib:buildTar --file pom.xml
+ run: mvnw.cmd ${{matrix.args}} -Dspotless.check.skip --batch-mode -no-transfer-progress verify jib:buildTar --file pom.xml
shell: cmd
examples:
diff --git a/planetiler-core/pom.xml b/planetiler-core/pom.xml
index 99016182..c2b88c09 100644
--- a/planetiler-core/pom.xml
+++ b/planetiler-core/pom.xml
@@ -47,7 +47,7 @@
org.locationtech.jts
jts-core
- 1.19.0
+ ${jts.version}
org.tukaani
diff --git a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/SeekableInMemoryByteChannel.java b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/SeekableInMemoryByteChannel.java
index bffdeb48..732b0098 100644
--- a/planetiler-core/src/main/java/com/onthegomap/planetiler/util/SeekableInMemoryByteChannel.java
+++ b/planetiler-core/src/main/java/com/onthegomap/planetiler/util/SeekableInMemoryByteChannel.java
@@ -24,6 +24,7 @@ import java.nio.channels.ClosedChannelException;
import java.nio.channels.SeekableByteChannel;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;
+import javax.annotation.concurrent.NotThreadSafe;
/**
* A {@link SeekableByteChannel} implementation that wraps a byte[].
@@ -38,8 +39,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
*
*
* @since 1.13
- * @NotThreadSafe
*/
+@NotThreadSafe
public class SeekableInMemoryByteChannel implements SeekableByteChannel {
private static final int NAIVE_RESIZE_LIMIT = Integer.MAX_VALUE >> 1;
diff --git a/planetiler-dist/pom.xml b/planetiler-dist/pom.xml
index f0ea5a43..945759c7 100644
--- a/planetiler-dist/pom.xml
+++ b/planetiler-dist/pom.xml
@@ -48,6 +48,19 @@
planetiler-examples
${project.parent.version}
+
+
+ com.onthegomap.planetiler
+ planetiler-core
+ ${project.parent.version}
+ sources
+
+
+ org.locationtech.jts
+ jts-core
+ ${jts.version}
+ sources
+
diff --git a/pom.xml b/pom.xml
index 12f8130a..40756aca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,6 +22,7 @@
true
2.17.1
5.10.2
+ 1.19.0
https://sonarcloud.io
onthegomap
onthegomap_planetiler
@@ -262,6 +263,21 @@
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.3.1
+
+
+ attach-sources
+ package
+
+ jar-no-fork
+ test-jar-no-fork
+
+
+
+
@@ -309,22 +325,6 @@
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.3.1
-
-
- attach-sources
- package
-
- jar-no-fork
- test-jar-no-fork
-
-
-
-
org.sonarsource.scanner.maven
sonar-maven-plugin
@@ -405,19 +405,6 @@
-
- org.apache.maven.plugins
- maven-source-plugin
-
-
- attach-sources
-
- jar-no-fork
- test-jar-no-fork
-
-
-
-