Skip to content

Instantly share code, notes, and snippets.

@gotnix
Last active December 23, 2019 16:27
Show Gist options
  • Select an option

  • Save gotnix/a52b67001ee4e241932e to your computer and use it in GitHub Desktop.

Select an option

Save gotnix/a52b67001ee4e241932e to your computer and use it in GitHub Desktop.
通过 JVM 系统属性使 Tomcat .war 包读取外部目录的配置。
/*
通过 JVM 系统属性使 Tomcat .war 包读取外部目录的配置,方便线上部署。演示命令:
java -Dapp_name.conf.dir=/var/www/config/app_name/ \
-Dapp_name.log.dir=/var/log/app_name/ \
Property
*/
// Property.java
import java.util.Properties;
public class Property {
public static void main(String[] args) {
System.getProperties().list(System.out);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment