forked from ERDDAP/erddap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
453 lines (396 loc) · 18.8 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is how Bob uses Maven for ERDDAP.
Maven users will probably be mystified/horrified,
but it works for me and does what I need it to do:
identify and gather all needed .jar dependencies
since this is impossible for AWS S3 dependencies without Maven.
* One time: Make a new Maven project/archetype:
cd \programs\mavenERDDAP
mvn -B archetype:generate -DgroupId=gov.noaa.pfel.erddap -DartifactId=ERDDAP -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4
* Update the version numbers starting with <dependencyManagement> section.
Website to search for maven plugins and dependencies: https://mvnrepository.com/
* Compile in Maven and gather dependency .jar files
(pom.xml based on Kyle's pom from https://github.com/axiom-data-science/erddap )
Copy Java source files from Tomcat/webapps/cwexperimental to Maven:
With bash:
cd /c/content/bat
./synchToMaven.sh
From Bash or DOS command line (after synchToMaven.sh has copied source files to Maven dir):
//mvn -help
//add -e for full error messages
//add -X for debug messages
cd /c/programs/mavenERDDAP/ERDDAP //pom.xml is there
mvn clean //removes previously generated .class files and ...
mvn compile //uses javac. Identifies missing dependencies/.jars.
mvn dependency:analyze //Identifies excess or missing dependencies/.jars.
// Expected: WARNINGS for Cassandra dependencies:
// guava, netty, snappy, lz4, metrics.
mvn package //Creates a war in \programs\mavenERDDAP\ERDDAP\target
* Temporarily rename tomcat/webapps/cwexperimental/WEB-INF/lib to today's date: /libYYYYMMDD
* Use 7zip to extract all .jar files
from inside C:\programs\mavenERDDAP\ERDDAP\target\ERDDAP-...-SNAPSHOT.war WEB-INF/lib directory
to tomcat/webapps/cwexperimental/WEB-INF/lib
The vast majority of .jars are from the AWS S3 dependency.
* If passes all tests, delete temporary libYYYYMMDD directory.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>gov.noaa.pfel.erddap</groupId>
<artifactId>ERDDAP</artifactId>
<version>2.12-SNAPSHOT</version>
<packaging>war</packaging>
<name>erddap</name>
<url>https://coastwatch.pfeg.noaa.gov/erddap/index.html</url>
<properties>
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>unidata-releases</id>
<name>UNIDATA Releases</name>
<url>https://artifacts.unidata.ucar.edu/content/repositories/unidata-releases/</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.csv</include>
<include>**/*.tsv</include>
<include>**/*.txt</include>
<include>**/*.cpt</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<failOnError>true</failOnError>
<source>1.8</source>
<target>1.8</target>
<excludes>
<exclude>gov/noaa/pfel/coastwatch/sgt/LandMask.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/sgt/MapGraph.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/sgt/MapProj.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/sgt/GSHHSNewOnHold.java_NOT_YET</exclude>
<exclude>gov/noaa/pfel/coastwatch/griddata/Grd.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/griddata/GridDataSetCWOpendap.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/griddata/GridDataSetPathfinder.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/griddata/WriteShapefile.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/pointdata/DigirIobisTDSP.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/pointdata/DigirObisTDSP.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/hdf/HdfWriter.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/HelloWorld.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromBinaryFile.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromMatFiles.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableCopyPost.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromBMDE.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromMWFS.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromNOS.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromNWISDV.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromPostDatabase.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/erddap/dataset/EDDTableFromPostNcFiles.javaINACTIVE</exclude>
<exclude>gov/noaa/pfel/coastwatch/util/FileVisitorDNLS.javaOLD</exclude>
</excludes>
</configuration>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-war-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>8081</port>
<path>/erddap</path>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/surefire-junit4 -->
<plugin>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.19.1</version>
</plugin>
<!-- https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils -->
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/bom
Parent for reading/writing to AWS S3. -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.16.52</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/junit/junit
There are newer versions with different domain name, but cause trouble with dependency checking.
For testing (by Kyle? Maven?). -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<!-- Kyle had this:
https://mvnrepository.com/artifact/org.apache.ant/ant
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.9</version>
</dependency> -->
<!--
https://mvnrepository.com/artifact/gnu-regexp/gnu-regexp
This is needed for dods.dap code I wasn't compiling but Maven does.
'provided' lets it compile here but then doesn't include the .jar in /lib in .war.
-->
<dependency>
<groupId>gnu-regexp</groupId>
<artifactId>gnu-regexp</artifactId>
<version>1.1.4</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/gnu.getopt/java-getopt
This is needed for dods.dap code I wasn't compiling but Maven does.
'provided' lets it compile here but then doesn't include the .jar in /lib in .war.
-->
<dependency>
<groupId>gnu.getopt</groupId>
<artifactId>java-getopt</artifactId>
<version>1.0.13</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.lowagie/itext
This is the pdf writer.
Newer version is available, but license now gpl?!
-->
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>1.3.1</version>
</dependency>
<!-- Kyle had this:
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.3</version>
</dependency-->
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-core
The Lucene search option uses this. -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>8.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-queryparser
The Lucene search option uses this. -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>8.8.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json
This is the JSON reader. -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<!-- I have private copy of source code in with my code.
2020-12-21 I tried to remove my copy and use this, but failed.
https://mvnrepository.com/artifact/org.jdom/jdom
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency-->
<!-- Kyle had this:
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency-->
<!-- Kyle had this:
<dependency>
<groupId>atg.taglib.json</groupId>
<artifactId>json-taglib</artifactId>
<version>0.4.1</version>
</dependency-->
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
This is the servlet API used by ERDDAP. -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.mail/jakarta.mail
Used to send emails. -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>2.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress
File2 and EDDTableFromNcFiles use this. -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jaxen/jaxen
org.jdom.xpath code uses this. -->
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/edu.ucar/netcdfAll
This is the netcdf-java library. -->
<dependency>
<groupId>edu.ucar</groupId>
<artifactId>netcdfAll</artifactId>
<version>5.4.1</version>
</dependency>
<!-- NO LONGER NEEDED! It's in netcdf-all.jar
and something else gets slf4j-api-...jar
https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
<scope>runtime</scope>
</dependency -->
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-jexl3
This is the expression parser/processor used by EDDTableFromFiles Derived Variables. -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-jexl3</artifactId>
<version>3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql
Postgresql users use this. I include for their convenience. -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.20</version>
</dependency>
<!-- CASSANDRA
https://mvnrepository.com/artifact/com.datastax.cassandra/cassandra-driver-core
Cassandra uses this. -->
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.11.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava
Cassandra driver uses this. -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.jpountz.lz4/lz4
Cassandra uses this. C* still refers to this older version from older domain. -->
<dependency>
<groupId>net.jpountz.lz4</groupId>
<artifactId>lz4</artifactId>
<version>1.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-core
Cassandra uses this. -->
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>4.1.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-all
Cassandra uses this. -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.63.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.xerial.snappy/snappy-java
Cassandra uses this. -->
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>1.1.8.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.dropwizard.metrics/metrics-jmx
2021-01-25 Tried: To deal with java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter
But now "metrics" option is always set to false.
See EDDTableFromCassandra references to JmxReporter.
See https://docs.datastax.com/en/developer/java-driver/3.5/manual/metrics/#metrics-4-compatibility
and need for Cluster.builder().withoutJMXReporting()
which is probably a workable solution.
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jmx</artifactId>
<version>4.1.16</version>
</dependency -->
<!-- AWS
https://mvnrepository.com/artifact/software.amazon.awssdk/s3
This is the core AWS SDK code.
See awssdk/bom in <dependencyManagement> section above. -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.16.52</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/regions
This is the AWS code for Regions. -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>regions</artifactId>
<version>2.16.52</version>
</dependency>
</dependencies>
</project>