From c95b079e8c76fe56fb798691c958c9c3277c2238 Mon Sep 17 00:00:00 2001 From: zengkid Date: Sat, 29 Jun 2024 00:44:54 +0800 Subject: [PATCH] be able to update server.xml under project --- CHANGELOG.md | 4 ++++ gradle.properties | 2 +- .../idea/plugins/tomcat/conf/TomcatCommandLineState.java | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 771f4d7..c3637b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # SmartTomcat Changelog +## [4.7.3] + +- be able to update the server.xml under the /.smarttomcat//conf. + ## [4.7.2] - Add option to disable run configuration from context. diff --git a/gradle.properties b/gradle.properties index 752c044..5a3eaf5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US pluginName = SmartTomcat pluginGroup = com.poratu.idea.plugins.tomcat -pluginVersion = 4.7.2 +pluginVersion = 4.7.3 pluginSinceBuild = 193.5233.102 pluginUntilBuild= diff --git a/src/main/java/com/poratu/idea/plugins/tomcat/conf/TomcatCommandLineState.java b/src/main/java/com/poratu/idea/plugins/tomcat/conf/TomcatCommandLineState.java index 49ae271..fda6bd6 100644 --- a/src/main/java/com/poratu/idea/plugins/tomcat/conf/TomcatCommandLineState.java +++ b/src/main/java/com/poratu/idea/plugins/tomcat/conf/TomcatCommandLineState.java @@ -118,11 +118,18 @@ protected JavaParameters createJavaParameters() { String extraClassPath = configuration.getExtraClassPath(); Map envOptions = configuration.getEnvOptions(); + //copy to project folder, and then user is able to update server.xml under the project. + Path projectConfPath = Paths.get(project.getBasePath(), ".smarttomcat", module.getName(), "conf"); + if (!projectConfPath.toFile().exists()) { + FileUtil.createDirectory(projectConfPath.toFile()); + FileUtil.copyDir(tomcatInstallationPath.resolve("conf").toFile(), projectConfPath.toFile()); + } + // Copy the Tomcat configuration files to the working directory Path confPath = catalinaBase.resolve("conf"); FileUtil.delete(confPath); FileUtil.createDirectory(confPath.toFile()); - FileUtil.copyDir(tomcatInstallationPath.resolve("conf").toFile(), confPath.toFile()); + FileUtil.copyDir(projectConfPath.toFile(), confPath.toFile()); // create the temp folder FileUtil.createDirectory(catalinaBase.resolve("temp").toFile());