maven exec 插件 - logback 不起作用
我有一个 Maven 项目,它保存配置信息并将其打包在 zip 文件中。我使用 Maven 依赖插件将内容解压到 ${project.build.directory}/unpacked,然后运行资源插件来过滤内容并将它们直接转储到 ${project.build.directory}。
当我运行 maven exec 时,我的 logback.xml 没有被拾取。看来类路径设置为 ${basedir},但我希望它同时具有 ${project.build.directory}、测试类、测试类和类。
每当我尝试添加类路径元素时,都会收到配置错误。
我应该如何配置我的 pom.xml 来支持这一点,这是否可能?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>run</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<workingDirectory>${project.build.directory}</workingDirectory>
<mainClass>${jar.mainClass}</mainClass>
</configuration>
</plugin>
I have a maven project which holds configuration information and has it packaged in a zip file. I use the maven dependency plugin to unpack the contents to ${project.build.directory}/unpacked and then run the resource plugin over that to filter the contents and dump them directly to ${project.build.directory}.
When I run maven exec, my logback.xml is not being picked up. It appears the classpath is set to ${basedir}, but I'd like it to have both ${project.build.directory}, that and test-classes, that and classes.
Anytime I try to add a classpath element, I get a configuration error.
How should I configure my pom.xml to support this and is this even possible?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>run</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<workingDirectory>${project.build.directory}</workingDirectory>
<mainClass>${jar.mainClass}</mainClass>
</configuration>
</plugin>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以解决问题。
This should solve the problem.