Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
46de7c9
openrewrite
axl8713 Jan 21, 2026
394bcee
not yet ready for jackson3
axl8713 May 6, 2026
bc1705c
jakarta
axl8713 May 6, 2026
db43ba0
spring security filters
axl8713 May 12, 2026
25f2650
removed gzip compression filter due to incompatibility.
axl8713 May 12, 2026
7eaafc8
tomcat 10
axl8713 May 12, 2026
43a721b
cargo upgrade and logging settings.
axl8713 May 13, 2026
d19e7fc
jakarta servlet 6 and tomcat 11
axl8713 May 18, 2026
8e2690b
mapfish-print upgrade
axl8713 May 18, 2026
c71335b
pom template alignment
axl8713 May 18, 2026
e258358
Merge branch 'master' into spring7
axl8713 May 26, 2026
83b3ac6
moved github workflows to JDK 21.
axl8713 May 26, 2026
30bd1f1
Merge branch 'master' into spring7
axl8713 May 26, 2026
d0e8722
Merge branch 'master' into spring7
axl8713 Jun 16, 2026
4326ade
Bumped jackson to 2.19.4.
axl8713 Jun 16, 2026
dde64a7
Set JDK 17 as minimum supported version.
axl8713 Jun 16, 2026
d914048
Merge branch 'master' into spring7
axl8713 Jun 17, 2026
295ddcb
Merge branch 'master' into spring7
axl8713 Jun 18, 2026
73484ee
Merge branch 'master' into spring7
axl8713 Jun 18, 2026
c080ca2
Merge branch 'master' into spring7
axl8713 Jun 22, 2026
3ffd3bb
Set jakarta version to 6.0.
axl8713 Jun 22, 2026
c272d2a
Bumped spring version to latest releases.
axl8713 Jun 23, 2026
3e466f8
Bumped http-proxy to 1.7-SNAPSHOT.
axl8713 Jun 23, 2026
f364fc8
Fixed UploadPluginController temp files usage and simplified code.
axl8713 Jun 24, 2026
8129f4a
Merge branch 'master' into spring7
axl8713 Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: ['11.x', '17.x', '21.x']
java-version: ['17.x', '21.x']
fail-fast: false
steps:
- name: "checking out"
Expand Down Expand Up @@ -111,19 +111,15 @@ jobs:
strategy:
matrix:
node-version: ['20.x', '22.x', '24.x']
java-version: ['11.x', '17.x', '21.x']
java-version: ['17.x', '21.x']
# Reduce the combinations to reduce the total number of jobs
exclude:
- node-version: '20.x'
java-version: '17.x'
- node-version: '20.x'
java-version: '21.x'
- node-version: '22.x'
java-version: '11.x'
- node-version: '22.x'
java-version: '21.x'
- node-version: '24.x'
java-version: '11.x'
- node-version: '24.x'
java-version: '17.x'
fail-fast: false
Expand Down Expand Up @@ -201,14 +197,14 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11.x'
java-version: '17.x'
############
# Publish
##########
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
server-id: geosolutions
server-username: MAVEN_USERNAME
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master
# using filter pattern: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '[cC][0-9][0-9][0-9]-+**' # c123 or c123-something for custom branch
- '[0-9][0-9][0-9][0-9].[0-9][0-9].xx' # stable brances. E.g. 2021.01.xx
- '[0-9][0-9][0-9][0-9].[0-9][0-9].xx' # stable branches. E.g. 2021.01.xx
- '[geonode]-[0-9].[0-9].x' # stable branches for GeoNode. E.g. geonode-4.4.x

jobs:
Expand All @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11.x'
java-version: '17.x'
############
# CACHING
##########
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: "setting up Java"
uses: actions/setup-java@v1
with:
java-version: '11.x'
java-version: '17.x'
############
# CACHING
##########
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
script: |
core.setFailed('This workflow can not run on master branch')
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11.x'
java-version: '17.x'
distribution: 'adopt'
cache: maven

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
script: |
core.setFailed('This workflow can not run on master branch')
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11.x'
java-version: '17.x'
distribution: 'adopt'
cache: maven

Expand Down
2 changes: 1 addition & 1 deletion binary/bin-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>http://www.geo-solutions.it</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>9.0.116</tomcat.version>
<tomcat.version>11.0.22</tomcat.version>
<binary.number>${mapstore2.version}</binary.number>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion binary/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<url>http://www.geo-solutions.it</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>9.0.118</tomcat.version>
<tomcat.version>11.0.22</tomcat.version>
<binary.number>${mapstore2.version}</binary.number>
</properties>
<dependencies>
Expand Down
7 changes: 3 additions & 4 deletions binary/tomcat/conf/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">

<!-- ======================== Introduction ============================== -->
<!-- This document defines default values for *all* web applications -->
Expand Down
9 changes: 4 additions & 5 deletions java/services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@
</dependency>

<!-- servlet -->
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>

<!-- json-lib -->
Expand Down Expand Up @@ -143,8 +142,8 @@
<version>3.10.1</version>
<configuration>
<encoding>utf8</encoding>
<source>8</source>
<target>8</target>
<source>17</source>
<target>17</target>
<debug>true</debug>
<encoding>UTF-8</encoding>
<!--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.geosolutions.mapstore.controllers;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import java.io.IOException;
import java.nio.file.Paths;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.stereotype.Controller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import java.util.function.Predicate;
import java.util.stream.Stream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import it.geosolutions.mapstore.utils.ResourceUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CloseShieldInputStream;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
Expand All @@ -24,14 +25,15 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
Expand Down Expand Up @@ -69,6 +71,8 @@ public class UploadPluginController extends BaseMapStoreController {
@Secured({"ROLE_ADMIN"})
@RequestMapping(value = "/uploadPlugin", method = RequestMethod.POST, headers = "Accept=application/json")
public @ResponseBody String uploadPlugin(InputStream dataStream) throws IOException {
File servletTempDir = (File) context.getAttribute(ServletContext.TEMPDIR);
Path tempDir = Files.createTempDirectory(servletTempDir.toPath(), "mapstore-upload-");
try (ZipInputStream zip = new ZipInputStream(dataStream)) {
ZipEntry entry = zip.getNextEntry();
String pluginName = null;
Expand All @@ -85,12 +89,12 @@ public class UploadPluginController extends BaseMapStoreController {

if (lower.endsWith("index.js")) {
bundleEntryName = normalizedEntry;
File tempBundle = File.createTempFile("mapstore-bundle", ".js");
File tempBundle = Files.createTempFile(tempDir, "mapstore-bundle", ".js").toFile();
storeAsset(zip, tempBundle);
// We'll resolve final relative target after we know pluginName
tempFilesToRelativeTargets.put(tempBundle, "__BUNDLE__");
} else if (lower.equals("index.json")) {
JsonNode json = readJSON(zip);
JsonNode json = readJSON(CloseShieldInputStream.wrap(zip));
JsonNode plugins = json.get("plugins");
if (plugins == null || !plugins.isArray() || plugins.isEmpty()) {
throw new IOException("Invalid bundle: index.json has no 'plugins' array");
Expand All @@ -108,13 +112,13 @@ public class UploadPluginController extends BaseMapStoreController {
addPluginConfiguration(plugin);
}
} else if (lower.startsWith("translations/")) {
File tempAsset = File.createTempFile("mapstore-asset-translations", ".json");
File tempAsset = Files.createTempFile(tempDir, "mapstore-asset-translations", ".json").toFile();
storeAsset(zip, tempAsset);
// Target relative to extensions root: <pluginName>/<translations/...>
tempFilesToRelativeTargets.put(tempAsset, PLUGIN_PATH_PREFIX + normalizedEntry);
addTranslations = true;
} else if (lower.startsWith("assets/")) {
File tempAsset = File.createTempFile("mapstore-asset", ".tmp");
File tempAsset = Files.createTempFile(tempDir, "mapstore-asset", ".tmp").toFile();
storeAsset(zip, tempAsset);
// Target relative to extensions root: <pluginName>/<assets/...>
tempFilesToRelativeTargets.put(tempAsset, PLUGIN_PATH_PREFIX + normalizedEntry);
Expand Down Expand Up @@ -159,6 +163,8 @@ public class UploadPluginController extends BaseMapStoreController {
}

return plugin.toString();
} finally {
FileUtils.deleteDirectory(tempDir.toFile());
}
}

Expand Down Expand Up @@ -212,7 +218,7 @@ private boolean shouldStorePluginsConfigAsPatch() {
private boolean canUseDataDir() {
return !getDataDir().isEmpty() &&
Stream.of(getDataDir().split(","))
.anyMatch(folder -> !folder.trim().isEmpty() && new File(folder).exists());
.anyMatch(folder -> !folder.trim().isEmpty() && new File(folder).exists());
}

/**
Expand Down Expand Up @@ -250,7 +256,7 @@ private boolean canUseDataDir() {
for (int i = 0; i < plugins.size(); i++) {
JsonNode plugin = plugins.get(i);
String name = plugin.has("name") ? plugin.get("name").asText()
: plugin.get("value").get("name").asText();
: plugin.get("value").get("name").asText();
if (name.contentEquals(pluginName)) {
toRemove = i;
}
Expand Down Expand Up @@ -445,7 +451,7 @@ private void storeJSONConfig(Object config, String configName) throws IOExceptio
}

private void addExtension(String pluginName, String pluginBundleRelative, String translationsRelative)
throws IOException {
throws IOException {
ObjectNode config;
Optional<File> extensionsConfigFile = findResource(getExtensionsConfigPath());
if (extensionsConfigFile.isPresent()) {
Expand Down Expand Up @@ -484,25 +490,16 @@ private ObjectNode getExtensionConfig() throws IOException {
}

private JsonNode readJSON(InputStream input) throws IOException {
byte[] buffer = new byte[4096];
int read;
StringBuilder json = new StringBuilder();
while ((read = input.read(buffer)) >= 0) {
json.append(new String(buffer, 0, read, StandardCharsets.UTF_8));
}
return jsonMapper.readTree(json.toString());
return jsonMapper.readTree(input);
}

private void storeAsset(ZipInputStream zip, File file) throws IOException {
try (FileOutputStream outFile = new FileOutputStream(file)) {
byte[] buffer = new byte[8192];
int read;
while ((read = zip.read(buffer)) >= 0) {
outFile.write(buffer, 0, read);
}
IOUtils.copy(zip, outFile);
}
}

@Override
public void setContext(ServletContext context) {
this.context = context;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.geosolutions.mapstore.filters;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.*;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

public class NoCacheFilter implements Filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.function.Predicate;
import java.util.stream.Stream;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

public class ResourceUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.io.File;
import java.io.IOException;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.io.File;
import java.io.IOException;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.io.File;
import java.io.IOException;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.apache.commons.io.FileUtils;
import org.junit.Before;
Expand Down
Loading
Loading