【发布时间】:2013-02-21 12:29:24
【问题描述】:
我必须构建包含所有依赖项和 log4j.properties 文件的 jar 文件。
我在 stackoverflow 上寻找答案,但没有运气。
现在我正在构建包含所有依赖项的 jar,但我现在不知道如何告诉 maven 将 log4j.properties 文件移动到 ma *.jar 文件中的 META-INF 目录。
我的 pom 的一部分,它生成带有依赖项的 jar:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
我必须做什么才能拥有包含所有依赖项和 log4j.properties 文件的 jar?
【问题讨论】:
-
文件在您当前项目结构中的位置?
-
log4j.properties 在 src/main/resources