Skip to content

Commit 01348b0

Browse files
committed
Maven download plugin unpackWhenChanged fixes
Apparently command line options don't override plugin configuration defined in the pom, and the solution to allow such behavior is to defined a property (which _is_ overridable via command line options) and reference that in the plugin config. https://issues.apache.org/jira/browse/MNG-4979 Also make sure ref/test data is unpacked during Github Actions maven builds.
1 parent e2d36ce commit 01348b0

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ jobs:
2222
mvn --batch-mode
2323
-Dgcf.skipInstallHooks=true
2424
-Dmaven.test.redirectTestOutputToFile=true
25+
-Ddownload.unpack=true
26+
-Ddownload.unpackWhenChanged=false
2527
clean verify

PROGRAMMER_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ERDDAP™ uses Maven to load code dependencies as well as some static reference
1919

2020
- [erddapContent.zip](https://github.com/ERDDAP/erddapContent/releases/download/content1.0.0/erddapContent.zip) (version 1.0.0, 20333 bytes, MD5=2B8D2A5AE5ED73E3A42B529C168C60B5, dated 2024-10-14) and unzip it into _tomcat_, creating _tomcat_/content/erddap .
2121

22-
NOTE: By default Maven will cache static reference and test data archive downloads and only extract them when a new version is downloaded. To skip downloading entirely, you may set the `skipResourceDownload` and/or `skipTestResourceDownload` properties to Maven (e.g. `mvn -DskipResourceDownload package`). To force extraction, set `-Ddownload.unpack`.
22+
NOTE: By default Maven will cache static reference and test data archive downloads and only extract them when a new version is downloaded. To skip downloading entirely, you may set the `skipResourceDownload` and/or `skipTestResourceDownload` properties to Maven (e.g. `mvn -DskipResourceDownload package`). To force extraction, set `-Ddownload.unpack=true` and `-Ddownload.unpackWhenChanged=false`.
2323

2424
- ERDDAP™ and its subcomponents have very liberal, open-source [licenses](https://erddap.github.io/setup.html#license), so you can use and modify the source code for any purpose, for-profit or not-for-profit. Note that ERDDAP™ and many subcomponents have licenses that require that you acknowledge the source of the code that you are using. See [Credits](https://erddap.github.io/setup.html#credits). Whether required or not, it is just good form to acknowledge all of these contributors.
2525

pom.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<test.resources.version>test1.04</test.resources.version>
5050
<jettyVersion>12.0.14</jettyVersion>
5151
<error-prone.version>2.27.0</error-prone.version>
52+
<download.unpackWhenChanged>true</download.unpackWhenChanged>
5253
</properties>
5354

5455
<repositories>
@@ -269,7 +270,7 @@
269270
</goals>
270271
<configuration>
271272
<url>https://github.com/ERDDAP/erddapContent/releases/download/${erddapcontent.download.version}/erddapContent.zip</url>
272-
<unpackWhenChanged>true</unpackWhenChanged>
273+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
273274
<outputDirectory>${project.basedir}</outputDirectory>
274275
<skip>${skipResourceDownload}</skip>
275276
</configuration>
@@ -282,7 +283,7 @@
282283
</goals>
283284
<configuration>
284285
<url>https://github.com/ERDDAP/ERDDAPRefFiles/releases/download/${erddapreffiles.download.version}/etopo1_ice_g_i2.zip</url>
285-
<unpackWhenChanged>true</unpackWhenChanged>
286+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
286287
<outputDirectory>${project.basedir}/WEB-INF/ref/</outputDirectory>
287288
<skip>${skipResourceDownload}</skip>
288289
</configuration>
@@ -295,7 +296,7 @@
295296
</goals>
296297
<configuration>
297298
<url>https://github.com/ERDDAP/ERDDAPRefFiles/releases/download/${erddapreffiles.download.version}/ref_files.zip</url>
298-
<unpackWhenChanged>true</unpackWhenChanged>
299+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
299300
<outputDirectory>${project.basedir}/WEB-INF/ref/</outputDirectory>
300301
<skip>${skipResourceDownload}</skip>
301302
</configuration>
@@ -309,7 +310,7 @@
309310
</goals>
310311
<configuration>
311312
<url>https://github.com/ERDDAP/erddapTest/releases/download/${test.resources.version}/data.zip</url>
312-
<unpackWhenChanged>true</unpackWhenChanged>
313+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
313314
<outputDirectory>${project.basedir}/test-data</outputDirectory>
314315
<skip>${skipTestResourceDownload}</skip>
315316
</configuration>
@@ -322,7 +323,7 @@
322323
</goals>
323324
<configuration>
324325
<url>https://github.com/ERDDAP/erddapTest/releases/download/${test.resources.version}/largeFiles.zip</url>
325-
<unpackWhenChanged>true</unpackWhenChanged>
326+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
326327
<outputDirectory>${project.basedir}/test-data</outputDirectory>
327328
<skip>${skipTestResourceDownload}</skip>
328329
</configuration>
@@ -335,7 +336,7 @@
335336
</goals>
336337
<configuration>
337338
<url>https://github.com/ERDDAP/erddapTest/releases/download/${test.resources.version}/largePoints.zip</url>
338-
<unpackWhenChanged>true</unpackWhenChanged>
339+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
339340
<outputDirectory>${project.basedir}/test-data</outputDirectory>
340341
<skip>${skipTestResourceDownload}</skip>
341342
</configuration>
@@ -348,7 +349,7 @@
348349
</goals>
349350
<configuration>
350351
<url>https://github.com/ERDDAP/erddapTest/releases/download/${test.resources.version}/largeSatellite.zip</url>
351-
<unpackWhenChanged>true</unpackWhenChanged>
352+
<unpackWhenChanged>${download.unpackWhenChanged}</unpackWhenChanged>
352353
<outputDirectory>${project.basedir}/test-data</outputDirectory>
353354
<skip>${skipTestResourceDownload}</skip>
354355
</configuration>

0 commit comments

Comments
 (0)