diff --git a/pom.xml b/pom.xml index c05150aa6..20ffe4f8e 100644 --- a/pom.xml +++ b/pom.xml @@ -556,6 +556,8 @@ org.dbflute.tomcat tomcat-boot ${tomcat.boot.version} + + provided diff --git a/src/main/assemblies/files/fess.in.sh b/src/main/assemblies/files/fess.in.sh index 0749e8292..b4a8e66ec 100755 --- a/src/main/assemblies/files/fess.in.sh +++ b/src/main/assemblies/files/fess.in.sh @@ -80,4 +80,5 @@ FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.name=$APP_NAME" FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.path=$FESS_HOME/logs" FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dfess.log.level=info" FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dlasta.env=production" +FESS_JAVA_OPTS="$FESS_JAVA_OPTS -Dtomcat.config.path=tomcat_config.properties" diff --git a/src/main/assemblies/files/tomcat_config.properties b/src/main/assemblies/files/tomcat_config.properties new file mode 100644 index 000000000..6a89128b8 --- /dev/null +++ b/src/main/assemblies/files/tomcat_config.properties @@ -0,0 +1,9 @@ +# ======================================================================================== +# Web +# ===== +# ---------------------------------------------------------- +# Tomcat +# ------ +tomcat.URIEncoding = UTF-8 +tomcat.useBodyEncodingForURI = true + diff --git a/src/main/assemblies/package.xml b/src/main/assemblies/package.xml index 49896432c..61252531c 100644 --- a/src/main/assemblies/package.xml +++ b/src/main/assemblies/package.xml @@ -51,6 +51,7 @@ ${project.basedir}/src/main/assemblies/files logging.properties + tomcat_config.properties fess-${project.version}/lib/classes diff --git a/src/main/java/org/codelibs/fess/FessBoot.java b/src/main/java/org/codelibs/fess/FessBoot.java index 0b5e9e802..f6dec9631 100644 --- a/src/main/java/org/codelibs/fess/FessBoot.java +++ b/src/main/java/org/codelibs/fess/FessBoot.java @@ -6,8 +6,6 @@ import org.dbflute.tomcat.TomcatBoot; public class FessBoot extends TomcatBoot { - private static final String FESS_ENV_PROPERTIES = "fess_env.properties"; - private static final String LOGGING_PROPERTIES = "logging.properties"; private static final String FESS_CONTEXT_PATH = "fess.context.path"; @@ -22,6 +20,8 @@ public class FessBoot extends TomcatBoot { private static final String JAVA_IO_TMPDIR = "java.io.tmpdir"; + private static final String TOMCAT_CONFIG_PATH = "tomcat.config.path"; + public FessBoot(final int port, final String contextPath) { super(port, contextPath); } @@ -60,16 +60,19 @@ public class FessBoot extends TomcatBoot { System.setProperty(JAVA_IO_TMPDIR, value); } - new FessBoot(getPort(), getContextPath()) // - .useTldDetect() // for JSP - .configure(FESS_ENV_PROPERTIES) // e.g. URIEncoding - .logging(LOGGING_PROPERTIES, op -> { - op.ignoreNoFile(); - final String fessHomeDir = System.getProperty("fess.home"); - if (fessHomeDir != null) { - op.replace("fess.home", fessHomeDir); - } - }) // uses jdk14logger + final String tomcatConfigPath = getTomcatConfigPath(); + TomcatBoot tomcatBoot = new FessBoot(getPort(), getContextPath()) // + .useTldDetect(); // for JSP + if (tomcatConfigPath != null) { + tomcatBoot.configure(tomcatConfigPath); // e.g. URIEncoding + } + tomcatBoot.logging(LOGGING_PROPERTIES, op -> { + op.ignoreNoFile(); + final String fessHomeDir = System.getProperty("fess.home"); + if (fessHomeDir != null) { + op.replace("fess.home", fessHomeDir); + } + }) // uses jdk14logger .asDevelopment(isNoneEnv()).bootAwait(); } @@ -92,4 +95,8 @@ public class FessBoot extends TomcatBoot { } return "/fess"; } + + protected static String getTomcatConfigPath() { + return System.getProperty(TOMCAT_CONFIG_PATH); + } } diff --git a/src/main/resources/fess_env.properties b/src/main/resources/fess_env.properties index 7aa7f8425..b75916a75 100644 --- a/src/main/resources/fess_env.properties +++ b/src/main/resources/fess_env.properties @@ -45,8 +45,4 @@ mail.return.path = root@localhost # ======================================================================================== # Web # ===== -# ---------------------------------------------------------- -# Tomcat -# ------ -tomcat.URIEncoding = UTF-8 -tomcat.useBodyEncodingForURI = true + diff --git a/src/main/resources/fess_env_production.properties b/src/main/resources/fess_env_production.properties index 683bba2ed..f0f16fd45 100644 --- a/src/main/resources/fess_env_production.properties +++ b/src/main/resources/fess_env_production.properties @@ -44,8 +44,4 @@ mail.return.path = root@localhost # ======================================================================================== # Web # ===== -# ---------------------------------------------------------- -# Tomcat -# ------ -tomcat.URIEncoding = UTF-8 -tomcat.useBodyEncodingForURI = true +