[英]Starting Tomcat 8 with Cargo in background
我正在嘗試使用Cargo和Tomcat 8(安裝模式)運行Web應用程序。 我將使用maven將Tomcat作為后台進程啟動(默認情況下,cargo:run阻止控制台,等待Ctrl + C),因此我將cargo.process.spawn
屬性設置為true
,但得到以下輸出:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building webapp-launcher 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.6.2:run (default-cli) @ webapp-launcher ---
[INFO] [en2.ContainerRunMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.6.2 for container tomcat8x
[INFO] [talledLocalContainer] Tomcat 8.x starting...
[INFO] [stalledLocalDeployer] Deploying [/home/tomcat/.m2/repository/<<****removed****>>/<<****removed****>>.war] to [/home/tomcat/<<****removed****>>/target/cargo/configurations/tomcat8x/webapps]...
[INFO] [talledLocalContainer] Tomcat 8.x started on port [8080]
[INFO] [talledLocalContainer] spawn does not allow attributes related to input, output, error, result
[INFO] [talledLocalContainer] spawn also does not allow timeout
[INFO] [talledLocalContainer] finally, spawn is not compatible with a nested I/O <redirector>
[INFO] Press Ctrl-C to stop the container...
我試圖將timeout
設置為0
,但沒有任何改變。
這是我用來部署Webapp的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dummy.test</groupId>
<artifactId>webapp-launcher</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<repositories>
<repository>
<id>nexus-snapshots-1</id>
<name>Snaphots</name>
<url>***********************removed***********************</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>nexus-releases-1</id>
<name>Releases</name>
<url>***********************removed***********************</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<version>***********************removed***********************</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.2</version>
<configuration>
<container>
<timeout>0</timeout>
<containerId>tomcat8x</containerId>
<artifactInstaller>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.12</version>
</artifactInstaller>
</container>
<configuration>
<type>standalone</type>
<properties>
<cargo.process.spawn>true</cargo.process.spawn>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>***********************removed***********************</groupId>
<artifactId>***********************removed***********************</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</build>
</project>
編輯:
我認為這是一個錯誤,因為org.codehaus.cargo.container.spi.jvm.DefaultJvmLauncherFactory
類設置了許多與生成模式不兼容的硬編碼參數(請參閱此行)。
它應該在貨運版本1.6.3中修復。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.