Skip to content

Commit ef7ed5d

Browse files
authored
Fix #68. Update project and add flags for Java9 (#69)
1 parent 1003d34 commit ef7ed5d

2 files changed

Lines changed: 160 additions & 60 deletions

File tree

pom.xml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,47 @@
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<!-- platform BOM versions -->
14+
<tomcat.port>8080</tomcat.port>
15+
<tomcat.version>9.0.116</tomcat.version>
16+
<jackson.version>2.16.1</jackson.version>
17+
<maven-resources-plugin.version>2.6</maven-resources-plugin.version>
18+
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
19+
<!-- Spring Framework & Security (aligned) -->
20+
<spring.security.version>5.7.13</spring.security.version>
21+
<spring.version>5.3.39</spring.version>
22+
<!-- other dependencies (aligned where applicable) -->
23+
<commons-pool.version>1.5.4</commons-pool.version>
24+
<ehcache-web.version>2.0.4</ehcache-web.version>
25+
<httpclient.version>4.5.13</httpclient.version>
26+
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
27+
<jaxws-api.version>2.3.1</jaxws-api.version>
28+
<junit.version>4.13.2</junit.version>
29+
<mockito-core.version>4.0.0</mockito-core.version>
30+
<cargo.version>1.10.2</cargo.version>
31+
<!-- MapStore‑specific -->
32+
<mapstore-services.version>1.10-SNAPSHOT</mapstore-services.version>
33+
<geostore-webapp.version>2.5-SNAPSHOT</geostore-webapp.version>
34+
<http_proxy.version>1.6-SNAPSHOT</http_proxy.version>
35+
<print-lib.version>2.3.4</print-lib.version>
1336
</properties>
1437

15-
1638
<build>
1739
</build>
18-
40+
<dependencyManagement>
41+
<dependencies>
42+
<!-- Jackson BOM (for to receive same version of jackson from print-lib. Fixes https://github.com/geosolutions-it/MapStore2/issues/11856 temporary)-->
43+
<dependency>
44+
<groupId>com.fasterxml.jackson</groupId>
45+
<artifactId>jackson-bom</artifactId>
46+
<version>${jackson.version}</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
</dependencies>
51+
</dependencyManagement>
1952
<modules>
2053
<module>web</module>
21-
<module>MapStore2/java/services</module>
2254
</modules>
2355

2456
</project>

web/pom.xml

Lines changed: 125 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,21 @@
1111
<name>Template project to create MapStore extensions - WAR</name>
1212
<url></url>
1313

14-
<properties>
15-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<tomcat.version>9.0.90</tomcat.version>
17-
<tomcat.port>8080</tomcat.port>
18-
<mapstore-services.version>1.10-SNAPSHOT</mapstore-services.version>
19-
<geostore-webapp.version>2.3-SNAPSHOT</geostore-webapp.version>
20-
<http_proxy.version>1.6-SNAPSHOT</http_proxy.version>
21-
<print-lib.version>2.3.1</print-lib.version>
22-
<httpclient.version>4.5.13</httpclient.version>
23-
<junit.version>4.13.1</junit.version>
24-
<mockito-core.version>4.0.0</mockito-core.version>
25-
<javax.servlet-api.version>3.0.1</javax.servlet-api.version>
26-
<ehcache-web.version>2.0.4</ehcache-web.version>
27-
<commons-pool.version>1.5.4</commons-pool.version>
28-
<jaxws-api.version>2.3.1</jaxws-api.version>
29-
</properties>
30-
3114
<dependencies>
32-
<!-- MapStore backend -->
15+
<!-- MapStore services -->
3316
<dependency>
3417
<groupId>it.geosolutions.mapstore</groupId>
3518
<artifactId>mapstore-services</artifactId>
3619
<version>${mapstore-services.version}</version>
3720
</dependency>
38-
21+
<!-- Jackson BOM (for to receive same version of jackson from print-lib)-->
22+
<dependency>
23+
<groupId>com.fasterxml.jackson</groupId>
24+
<artifactId>jackson-bom</artifactId>
25+
<version>${jackson.version}</version>
26+
<type>pom</type>
27+
<scope>import</scope>
28+
</dependency>
3929
<!-- ================================================================ -->
4030
<!-- GeoStore modules -->
4131
<!-- ================================================================ -->
@@ -53,7 +43,6 @@
5343
<type>war</type>
5444
<scope>runtime</scope>
5545
</dependency>
56-
5746
<!-- JUnit -->
5847
<dependency>
5948
<groupId>junit</groupId>
@@ -86,19 +75,13 @@
8675
<artifactId>commons-pool</artifactId>
8776
<version>${commons-pool.version}</version>
8877
</dependency>
89-
<dependency>
90-
<groupId>javax.xml.ws</groupId>
91-
<artifactId>jaxws-api</artifactId>
92-
<version>${jaxws-api.version}</version>
93-
</dependency>
9478
</dependencies>
95-
9679
<build>
9780
<finalName>mapstore</finalName>
9881
<plugins>
9982
<plugin>
10083
<artifactId>maven-resources-plugin</artifactId>
101-
<version>2.6</version>
84+
<version>${maven-resources-plugin.version}</version>
10285
<executions>
10386
<execution>
10487
<id>version</id>
@@ -173,7 +156,7 @@
173156
<goal>copy-resources</goal>
174157
</goals>
175158
<configuration>
176-
<outputDirectory>${basedir}/target/__PROJECTNAME__</outputDirectory>
159+
<outputDirectory>${basedir}/target/mapstore</outputDirectory>
177160
<encoding>UTF-8</encoding>
178161
<resources>
179162
<resource>
@@ -196,7 +179,7 @@
196179
<goal>copy-resources</goal>
197180
</goals>
198181
<configuration>
199-
<outputDirectory>${basedir}/target/__PROJECTNAME__</outputDirectory>
182+
<outputDirectory>${basedir}/target/mapstore</outputDirectory>
200183
<encoding>UTF-8</encoding>
201184
<resources>
202185
<resource>
@@ -258,7 +241,6 @@
258241
<exclude>node_modules/**/*</exclude>
259242
<exclude>MapStore2/*</exclude>
260243
<exclude>MapStore2/**/*</exclude>
261-
<exclude>**/libs/Cesium/**/*</exclude>
262244
<exclude>**/test-resources/*</exclude>
263245
</excludes>
264246
</resource>
@@ -315,6 +297,25 @@
315297
</resource>
316298
</resources>
317299
</configuration>
300+
</execution>
301+
<execution>
302+
<id>printing</id>
303+
<phase>process-classes</phase>
304+
<goals>
305+
<goal>copy-resources</goal>
306+
</goals>
307+
<configuration>
308+
<outputDirectory>${basedir}/target/mapstore/printing</outputDirectory>
309+
<encoding>UTF-8</encoding>
310+
<resources>
311+
<resource>
312+
<directory>${basedir}/../MapStore2/java/printing/resources/geoserver/print</directory>
313+
<includes>
314+
<include>*</include>
315+
</includes>
316+
</resource>
317+
</resources>
318+
</configuration>
318319
</execution>
319320
<execution>
320321
<id>translations-ms2</id>
@@ -342,11 +343,11 @@
342343
<goal>copy-resources</goal>
343344
</goals>
344345
<configuration>
345-
<outputDirectory>${basedir}/target/mapstore/MapStore2/web/client</outputDirectory>
346+
<outputDirectory>${basedir}/target/mapstore/MapStore2/web/client/configs</outputDirectory>
346347
<encoding>UTF-8</encoding>
347348
<resources>
348349
<resource>
349-
<directory>${basedir}/../MapStore2/web/client</directory>
350+
<directory>${basedir}/../MapStore2/web/client/configs</directory>
350351
<includes>
351352
<include>localConfig.json</include>
352353
</includes>
@@ -360,15 +361,18 @@
360361
<plugin>
361362
<groupId>org.apache.maven.plugins</groupId>
362363
<artifactId>maven-war-plugin</artifactId>
363-
<version>3.4.0</version>
364+
<version>${maven-war-plugin.version}</version>
364365
<configuration>
365-
<packagingExcludes>WEB-INF/lib/commons-codec-1.2.jar,
366-
WEB-INF/lib/commons-io-1.1.jar,
367-
WEB-INF/lib/commons-logging-1.0.4.jar,
368-
WEB-INF/lib/commons-pool-1.3.jar,
369-
WEB-INF/lib/slf4j-api-1.5*.jar,
370-
WEB-INF/lib/slf4j-log4j12-1.5*.jar,
371-
WEB-INF/lib/spring-tx-5.2.15*.jar
366+
<packagingExcludes>
367+
WEB-INF/lib/*spring*5.3.18*.jar,
368+
WEB-INF/lib/json-lib-2.4-jdk15.jar,
369+
WEB-INF/lib/msg-simple-1.1.jar,
370+
WEB-INF/lib/btf-1.2.jar,
371+
WEB-INF/lib/commons-io-2.1.jar,
372+
WEB-INF/lib/commons-beanutils-1.8.0.jar,
373+
WEB-INF/lib/commons-logging-1.1.1.jar,
374+
WEB-INF/lib/jackson-coreutils-1.6.jar,
375+
WEB-INF/lib/stax-ex-1.8.jar
372376
</packagingExcludes>
373377
<overlays>
374378
<overlay>
@@ -386,12 +390,13 @@
386390
<plugin>
387391
<groupId>org.codehaus.cargo</groupId>
388392
<artifactId>cargo-maven3-plugin</artifactId>
393+
<version>${cargo.version}</version>
389394
<configuration>
390395
<container>
391396
<containerId>tomcat9x</containerId>
392397
<zipUrlInstaller>
393398
<url>
394-
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/${tomcat.version}/tomcat-${tomcat.version}.zip
399+
https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/${tomcat.version}/tomcat-${tomcat.version}.zip
395400
</url>
396401
</zipUrlInstaller>
397402
</container>
@@ -401,6 +406,10 @@
401406
${project.build.directory}/apache-tomcat-${tomcat.version}
402407
</home>
403408
<properties>
409+
<cargo.jvmargs>
410+
--add-opens=java.base/java.lang=ALL-UNNAMED
411+
--add-opens=java.base/java.io=ALL-UNNAMED
412+
</cargo.jvmargs>
404413
<cargo.servlet.port>${tomcat.port}</cargo.servlet.port>
405414
<cargo.logging>low</cargo.logging>
406415
</properties>
@@ -437,13 +446,72 @@
437446
<activation>
438447
<activeByDefault>false</activeByDefault>
439448
</activation>
449+
<build>
450+
<plugins>
451+
<plugin>
452+
<groupId>com.coderplus.maven.plugins</groupId>
453+
<artifactId>copy-rename-maven-plugin</artifactId>
454+
<version>1.0</version>
455+
<executions>
456+
<execution>
457+
<id>rename-context</id>
458+
<phase>prepare-package</phase>
459+
<goals>
460+
<goal>copy</goal>
461+
</goals>
462+
<configuration>
463+
<overWrite>true</overWrite>
464+
<sourceFile>src/printing/applicationContext-print.xml</sourceFile>
465+
<destinationFile>target/mapstore/WEB-INF/classes/applicationContext-print.xml</destinationFile>
466+
</configuration>
467+
</execution>
468+
</executions>
469+
</plugin>
470+
</plugins>
471+
</build>
440472
<dependencyManagement>
441473
<dependencies>
442474
<dependency>
443475
<groupId>org.apache.httpcomponents</groupId>
444476
<artifactId>httpclient</artifactId>
445477
<version>${httpclient.version}</version>
446478
</dependency>
479+
<!-- JUnit -->
480+
<dependency>
481+
<groupId>junit</groupId>
482+
<artifactId>junit</artifactId>
483+
<scope>test</scope>
484+
<version>${junit.version}</version>
485+
</dependency>
486+
<!-- mockito -->
487+
<dependency>
488+
<groupId>org.mockito</groupId>
489+
<artifactId>mockito-core</artifactId>
490+
<version>${mockito-core.version}</version>
491+
</dependency>
492+
<!-- servlet -->
493+
<dependency>
494+
<groupId>javax.servlet</groupId>
495+
<artifactId>javax.servlet-api</artifactId>
496+
<version>${javax.servlet-api.version}</version>
497+
</dependency>
498+
<!-- gzip compression filter -->
499+
<dependency>
500+
<groupId>net.sf.ehcache</groupId>
501+
<artifactId>ehcache-web</artifactId>
502+
<version>${ehcache-web.version}</version>
503+
</dependency>
504+
<!-- misc -->
505+
<dependency>
506+
<groupId>commons-pool</groupId>
507+
<artifactId>commons-pool</artifactId>
508+
<version>${commons-pool.version}</version>
509+
</dependency>
510+
<dependency>
511+
<groupId>javax.xml.ws</groupId>
512+
<artifactId>jaxws-api</artifactId>
513+
<version>${jaxws-api.version}</version>
514+
</dependency>
447515
</dependencies>
448516
</dependencyManagement>
449517
<dependencies>
@@ -477,6 +545,15 @@
477545
<groupId>org.springframework</groupId>
478546
<artifactId>spring-context</artifactId>
479547
</exclusion>
548+
<!-- drop the HTTP Client and Core jar -->
549+
<exclusion>
550+
<groupId>org.apache.httpcomponents</groupId>
551+
<artifactId>httpclient</artifactId>
552+
</exclusion>
553+
<exclusion>
554+
<groupId>org.apache.httpcomponents</groupId>
555+
<artifactId>httpcore</artifactId>
556+
</exclusion>
480557
</exclusions>
481558
</dependency>
482559
</dependencies>
@@ -494,28 +571,19 @@
494571
</snapshots>
495572
</repository>
496573

497-
<!-- Spring -->
498574
<repository>
499-
<id>spring-release</id>
500-
<name>Spring Portfolio Release Repository</name>
501-
<url>https://maven.springframework.org/release</url>
502-
<snapshots>
503-
<enabled>false</enabled>
504-
</snapshots>
505-
</repository>
506-
<repository>
507-
<id>spring-external</id>
508-
<name>Spring Portfolio External Repository</name>
509-
<url>https://maven.springframework.org/external</url>
575+
<id>osgeo</id>
576+
<name>Open Source Geospatial Foundation Repository</name>
577+
<url>https://repo.osgeo.org/repository/release/</url>
510578
<snapshots>
511-
<enabled>false</enabled>
579+
<enabled>true</enabled>
512580
</snapshots>
513581
</repository>
514-
582+
<!-- OSGEO snapshot (mapfish-print)-->
515583
<repository>
516-
<id>osgeo</id>
584+
<id>osgeo-snapshot</id>
517585
<name>Open Source Geospatial Foundation Repository</name>
518-
<url>https://repo.osgeo.org/repository/release/</url>
586+
<url>https://repo.osgeo.org/repository/snapshot/</url>
519587
<snapshots>
520588
<enabled>true</enabled>
521589
</snapshots>

0 commit comments

Comments
 (0)