如何在maven项目中将log4j添加到我的类路径中 org.apache.log4j.PropertyConfigurator.configure( “log4j.properties”); 给我错误
log4j:ERROR Could not read configuration file [log4j.properties].
java.io.FileNotFoundException: log4j.properties (No such file or directory)
答案 0 :(得分:1)
您通常会将这些属性文件添加到maven项目的src/main/resources
文件夹中,并将其包含在pom.xml
的构建属性中:
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>