gpt4 book ai didi

maven - Apache Tomcat Maven 插件 exec-war-only 目标的日志记录配置?

转载 作者:行者123 更新时间:2023-11-28 21:51:26 27 4
gpt4 key购买 nike

我想通过 @ http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/exec-war-only-mojo.html#extraResources 中描述的 extraResources 标签指定一个日志配置文件并收到以下 Maven 错误

Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:exec-war-only (tomcat-run) on project iot-service-embedded-tomcat: Unable to parse configuration of mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:exec-war-only for parameter extraResource: Cannot configure instance of org.apache.tomcat.maven.plugin.tomcat7.run.ExtraResource from log4j.properties

Here's the maven plugin entry:

<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
...
<extraResources>
<extraResource>
log4j.properties
</extraResource>
</extraResources>
<extraDependencies>
...
<extraDependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<scope>compile</scope>
</extraDependency>
</extraDependencies>
...
</configuration>
</execution>
</executions>
</plugin>

什么是正确的语法?

最佳答案

我能够通过查看 Maven 模型资源类中的 getter/setter 找到答案。正确的语法是:

<extraResources>
<extraResource>
<directory>path/to/resource/</directory>
<includes>
<include>resource.file.name</include>
</includes>
</extraResource>
</extraResources>

关于maven - Apache Tomcat Maven 插件 exec-war-only 目标的日志记录配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21464344/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com