mvn package 将我的配置 .properties 文件放在类路径中,但我需要将我的 config.properties 文件放在 mvn package 之后的特定文件夹中
mvn package is putting my config .properties file in classpath but I need to put my config.properties file in specific folder after mvn package
我的 config.properties 在 src/main/resources 中,但是在 mvn 包之后,config.properties 被拉到类路径中。我正在尝试构建可运行的 jar 文件。在查看可运行的 jar 文件后,我看到 config.properties 在类路径中。如何将 config.properties 放入资源文件夹。我得到空指针,因为我无法编辑的 jar 文件之一正在 /resources 文件夹中查看此 config.properties。
Coudn't find XX-XX config file for the filepath:config.properties
您可以在资源文件夹中创建资源文件夹:
src/main/resources/resources/config.properties
src/main/resources 中的所有内容都在类路径根目录中。所以属性文件将在 resources/config.properties.
我的 config.properties 在 src/main/resources 中,但是在 mvn 包之后,config.properties 被拉到类路径中。我正在尝试构建可运行的 jar 文件。在查看可运行的 jar 文件后,我看到 config.properties 在类路径中。如何将 config.properties 放入资源文件夹。我得到空指针,因为我无法编辑的 jar 文件之一正在 /resources 文件夹中查看此 config.properties。
Coudn't find XX-XX config file for the filepath:config.properties
您可以在资源文件夹中创建资源文件夹:
src/main/resources/resources/config.properties
src/main/resources 中的所有内容都在类路径根目录中。所以属性文件将在 resources/config.properties.