tomcat7:exec-war

全名:

org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:exec-war

描述:

创建一个包含所有必要 Apache Tomcat 类的自执行 JAR 文件。这允许仅使用 `java -jar mywebapp.jar`来运行您的 Web 应用程序,而无需安装 Tomcat 实例。更多详情在此处

属性:

  • 需要执行 Maven 项目。
  • 此目标是线程安全的,并支持并行构建。
  • 起始版本2.0.
  • 在执行自身之前,调用 生命周期阶段package的执行。

必需参数

名称 类型 起始 描述
accessLogValveFormat String 2.0 参见 https://tomcat.net.cn/tomcat-7.0-doc/config/valve.html
默认值为: %h %l %u %t %r %s %b %I %D.
用户属性为: maven.tomcat.exec.war.accessLogValveFormat.
attachArtifact boolean 2.0 是否将生成的构件附加到构建中(如果要安装或部署它,请使用 true)
默认值为: true.
用户属性为: maven.tomcat.exec.war.attachArtifact.
attachArtifactClassifier String 2.0 用于附加/生成的构件的分类器
默认值为: exec-war.
用户属性为: maven.tomcat.exec.war.attachArtifactClassifier.
attachArtifactClassifierType String 2.0 用于附加/生成的构件的类型
默认值为: jar.
用户属性为: maven.tomcat.exec.war.attachArtifactType.
connectorHttpProtocol String 2.0 要使用的连接器协议 HTTP/1.1 或 org.apache.coyote.http11.Http11NioProtocol
默认值为: HTTP/1.1.
用户属性为: maven.tomcat.exec.war.connectorHttpProtocol.
enableNaming boolean 2.0 在启动 Tomcat 时启用命名
默认值为: false.
用户属性为: maven.tomcat.exec.war.enableNaming.
finalName String 2.0 生成的执行 JAR 的名称。
默认值为: ${project.artifactId}-${project.version}-war-exec.jar.
用户属性为: tomcat.jar.finalName.
mainClass String 2.0 用于启动独立 JAR 的主类。
默认值为: org.apache.tomcat.maven.runner.Tomcat7RunnerCli.
用户属性为: maven.tomcat.exec.war.mainClass.
path String 2.0 运行的 Web 应用程序要使用的 Web 应用上下文路径。在执行 JAR 中存储 Web 应用的名称。不要使用 /
默认值为: ${project.artifactId}.
用户属性为: maven.tomcat.path.
pluginArtifacts List 2.0 (无描述)
默认值为: ${plugin.artifacts}.

可选参数

名称 类型 起始 描述
buildDirectory File 2.0 (无描述)
默认值为: ${project.build.directory}.
excludes String[] 2.2 要从 extraDependencies 中排除的文件模式
extraDependencies List 2.0 要添加到独立 Tomcat JAR 中的额外依赖项列表:您的 JDBC 驱动程序、mail.jar 等。这些依赖项将位于根类加载器中。
extraResources List 2.0 要添加到独立 Tomcat JAR 中的额外资源列表:您的日志配置等
httpPort String 2.2 为独立 JAR 配置默认 HTTP 端口
用户属性为: maven.tomcat.exec.war.httpPort.
pluginWorkDirectory File 2.0 此 Mojo 进行临时工作的路径,位于buildDirectory之下。
默认值为: ${project.build.directory}/tomcat7-maven-plugin-exec.
serverXml File 2.0 (无描述)
默认值为: src/main/tomcatconf/server.xml.
用户属性为: maven.tomcat.exec.war.serverXml.
skip boolean 2.2 跳过执行
默认值为: false.
用户属性为: maven.tomcat.skip.
tomcatConfigurationFilesDirectory File 2.0 (无描述)
默认值为: src/main/tomcatconf.
用户属性为: maven.tomcat.exec.war.tomcatConf.
warRunDependencies List 2.0 (无描述)

参数详情

accessLogValveFormat:

参见 https://tomcat.net.cn/tomcat-7.0-doc/config/valve.html
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.accessLogValveFormat
  • 默认: %h %l %u %t %r %s %b %I %D

attachArtifact:

是否将生成的构件附加到构建中(如果要安装或部署它,请使用 true)
  • 类型: boolean
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.attachArtifact
  • 默认: true

attachArtifactClassifier:

用于附加/生成的构件的分类器
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.attachArtifactClassifier
  • 默认: exec-war

attachArtifactClassifierType:

用于附加/生成的构件的类型
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.attachArtifactType
  • 默认: jar

buildDirectory:

(无描述)
  • 类型: java.io.File
  • 起始: 2.0
  • 必需:
  • 默认: ${project.build.directory}

connectorHttpProtocol:

要使用的连接器协议 HTTP/1.1 或 org.apache.coyote.http11.Http11NioProtocol
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.connectorHttpProtocol
  • 默认: HTTP/1.1

enableNaming:

在启动 Tomcat 时启用命名
  • 类型: boolean
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.enableNaming
  • 默认: false

excludes:

要从 extraDependencies 中排除的文件模式
  • 类型: java.lang.String[]
  • 起始: 2.2
  • 必需:

extraDependencies:

要添加到独立 Tomcat JAR 中的额外依赖项列表:您的 JDBC 驱动程序、mail.jar 等。这些依赖项将位于根类加载器中。
  • 类型: java.util.List
  • 起始: 2.0
  • 必需:

extraResources:

要添加到独立 Tomcat JAR 中的额外资源列表:您的日志配置等
  • 类型: java.util.List
  • 起始: 2.0
  • 必需:

finalName:

生成的执行 JAR 的名称。
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: tomcat.jar.finalName
  • 默认: ${project.artifactId}-${project.version}-war-exec.jar

httpPort:

为独立 JAR 配置默认 HTTP 端口
  • 类型: java.lang.String
  • 起始: 2.2
  • 必需:
  • 用户属性: maven.tomcat.exec.war.httpPort

mainClass:

用于启动独立 JAR 的主类。
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.mainClass
  • 默认: org.apache.tomcat.maven.runner.Tomcat7RunnerCli

path:

运行的 Web 应用程序要使用的 Web 应用上下文路径。在执行 JAR 中存储 Web 应用的名称。不要使用 /
  • 类型: java.lang.String
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.path
  • 默认: ${project.artifactId}

pluginArtifacts:

(无描述)
  • 类型: java.util.List
  • 起始: 2.0
  • 必需:
  • 默认: ${plugin.artifacts}

pluginWorkDirectory:

此 Mojo 进行临时工作的路径,位于buildDirectory之下。
  • 类型: java.io.File
  • 起始: 2.0
  • 必需:
  • 默认: ${project.build.directory}/tomcat7-maven-plugin-exec

serverXml:

(无描述)
  • 类型: java.io.File
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.serverXml
  • 默认: src/main/tomcatconf/server.xml

skip:

跳过执行
  • 类型: boolean
  • 起始: 2.2
  • 必需:
  • 用户属性: maven.tomcat.skip
  • 默认: false

tomcatConfigurationFilesDirectory:

(无描述)
  • 类型: java.io.File
  • 起始: 2.0
  • 必需:
  • 用户属性: maven.tomcat.exec.war.tomcatConf
  • 默认: src/main/tomcatconf

warRunDependencies:

(无描述)
  • 类型: java.util.List
  • 起始: 2.0
  • 必需: