Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Maven 项目 org.apache.log4j.PropertyConfigurator.configure("log4j.properties") 中将 log4j 添加到我的类路径中;给我错误
log4j:ERROR Could not read configuration file [log4j.properties]. java.io.FileNotFoundException: log4j.properties (No such file or directory)
您通常将这些属性文件添加到src/main/resourcesMaven 项目的文件夹中,并将其包含在以下构建属性中pom.xml:
src/main/resources
pom.xml
<build> <resources> <resource> <directory>src/main/resources</directory> </resource> </resources> </build>