我想控制maven生成的EAR的远程部署到未在构建服务器上运行的现有WAS实例.
理想情况下,我想在Maven中执行此操作,以便我可以在集成测试阶段进行远程部署,然后在验证阶段继续运行一些JMeters.我想这很标准.
我环顾四周,无法在WAS 8.5中找到合理的方法.
有几篇文章:
和网络上的其他人,包括IBM.似乎没有提供实现远程部署到WAS 8.5的方法
有人有解决方案吗?
编辑1:IBM进一步确认没有正式的maven解决方案可以在这里找到:
Spring源代码示例使用maven tomcat插件,我可以使用命令运行这些项目mvn tomcat:run
但是我没看到应用程序没有部署在本地tomcat服务器("C:\ apache tomcat\webapps \")中.
它与货物插件有何不同?(在这种情况下,当我运行命令时mvn cargo:redeploy
,我看到部署在"C:\ apache tomcat\webapps \"位置的应用程序)
如果我将货物插件添加到弹簧示例的POM(如mvn-showcase,petclinic)..它会搞砸了吗?
我正在尝试使用Netbeans 从Java 7/8 EE教程*部署第一个示例(hello1),我遇到了问题.项目编译没有问题,但在部署时会出错:
Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.2:redeploy (deploy) on project hello1: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.2:redeploy failed: Failed to create deployer with implementation class org.codehaus.cargo.container.glassfish.GlassFish4xInstalledLocalDeployer for the parameters (container [id = [glassfish4x]], deployer type [installed]). InvocationTargetException: The container configuration directory "/home/DeltaLima/glassfish4/glassfish/domains" does not exist. Please configure the container before attempting to perform any local deployment. Read more on: http://cargo.codehaus.org/Local+Configuration -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
与教程相反,我在/ opt/glassfish-v4中安装了GlassFish服务器,而不是/ home/DeltaLima/glassfish4.在Netbeans中我以这种方式进行配置,因此我可以毫无问题地启动,停止和检查服务器的状态.服务器配置中的域文件夹已正确设置.
似乎与Netbeans捆绑的Maven安装期望服务器安装在用户的主目录中.
我是Java EE,Netbeans和Maven的新手,因此我没有配置Netbeans/Maven的经验,错误消息中提供的教程或链接都没有多大帮助.
如何在Netbeans中设置项目,使其部署在正确的目录中?
Netbeans版本7.3.1
Glassfish版本4.0
操作系统:Ubuntu
*答案已更新,以便考虑Java 8 EE
我正在寻找一种将环境变量传递到货物集装箱的方法.像这样的东西:
<plugin>
<groupId>org.codehaus.cargo>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<environmentVariables>
<myCustomVariable>value</myCustomVariable>
...
Run Code Online (Sandbox Code Playgroud) 我正在尝试通过https从Maven部署到远程Tomcat7.
我已经设置了manager-script角色,并且我已经成功地能够远程取消部署应用程序.
我看起来像这样:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.1.2</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>https://xxx/manager/text</cargo.remote.uri>
<cargo.remote.username>${tomcat.username}</cargo.remote.username>
<cargo.remote.password>${tomcat.password}</cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>mycomp</groupId>
<artifactId>myartifact</artifactId>
<type>war</type>
<properties>
<context>/</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
好吧,我知道凭据和一切都设置正确,我已经使用了新的/文本界面,我已经能够取消部署现有的应用程序.但是在尝试运行部署时:
mvn cargo:deployer-deploy -e
Run Code Online (Sandbox Code Playgroud)
我的根本原因是错误的:
Caused by: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2809)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2792)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:605)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:501)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:569)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:273)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:256)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:240)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
... 25 more
Run Code Online (Sandbox Code Playgroud)
我马上得到它所以它不能超时.
文件可以变大吗?这是一场60 MB的战争.我确保我的nginx允许更大:
client_max_body_size 200M;
Run Code Online (Sandbox Code Playgroud)
我还在管理器webapps …
如果可能的话,我想将Tomcat的context.xml文件保留在WAR文件的META-INF目录之外.这可以用Maven的货物插件完成吗?我似乎找不到正确的配置.
我正在从Maven的jetty插件迁移到Cargo插件(cargo-maven2-plugin),因为Cargo将很乐意从依赖的Maven模块运行WAR.在网络应用程序中,我们花了很大力气通过JNDI外部化所有配置.这些JNDI定义是特定于Web应用程序的,因此放在WAR外部的jetty-env.xml文件中.使用Jetty插件,我们将此文件指定如下:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<jettyEnvXml>${basedir}/target/config/jetty-env.xml</jettyEnvXml>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
如何在Cargo Plugin中指定它?这是我到目前为止的配置.当然,由于缺少JNDI配置,它失败了:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>jetty6x</containerId>
<type>embedded</type>
</container>
<configuration>
<deployables>
<deployable>
<groupId>com.mycompany</groupId>
<artifactId>my-war-module</artifactId>
<type>war</type>
<properties>
<context>/</context>
</properties>
</deployable>
</deployables>
</configuration>
<wait>false</wait>
</configuration>
<executions>
......
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud) 我正在使用Cargo Maven插件将WAR部署到远程服务器,我遇到了问题.我可能会为这个问题创建第二个问题,但是这个问题是关于覆盖Maven插件的log4j配置.Cargo使用JBoss的客户端库将东西发送到JBoss服务器(我正在尝试这样做.)JBoss库使用log4j.Cargo没有设置我所知道的任何类型的映射层.
因此,基本上,日志消息发生在Maven插件的依赖库中.我尝试设置-Dlog4j.debug并获取此信息:
Run Code Online (Sandbox Code Playgroud)log4j: Trying to find [log4j.xml] using ClassRealm[plugin>org.codehaus.cargo:cargo-maven2-plugin:1.0.5, parent: ClassRealm[maven.api, parent: null]] class loader. log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource(). log4j: Trying to find [log4j.properties] using context classloader ClassRealm[plugin>org.codehaus.cargo:cargo-maven2-plugin:1.0.5, parent: ClassRealm[maven.api, parent: null]]. log4j: Using URL [jar:file:/C:/Users/username/.m2/repository/org/jboss/jbossts/jbossjts/4.13.1.Final/jbossjts-4.13.1.Final.jar!/log4j.properties] for automatic log4j configuration. log4j: Reading configuration from URL jar:file:/C:/Users/username/.m2/repository/org/jboss/jbossts/jbossjts/4.13.1.Final/jbossjts-4.13.1.Final.jar!/log4j.properties log4j: Could not find root logger information. Is this OK? log4j: Parsing for [com.arjuna] with value=[INFO, default, stdout]. log4j: Level token is [INFO]. log4j: Category com.arjuna set …
我想将我的应用程序分发为嵌入在Apache Tomcat中的WAR.那就是我想要将Tomcat与我的应用程序一起分发.
如何使用Maven完成这种分发包装?
我见过Maven Cargo Plugin,但似乎是为了在本地容器中部署应用程序.也许我需要的是对Cargo插件的额外步骤.cargo:package
似乎很有趣,但缺乏文档.
每当我通过 CMD 启动应用程序时,它都会启动,但是如果我通过 eclipse 运行相同的代码,则会出现下面提到的错误...
[DEBUG] [URLDeployableMonitor] Checking URL [http://localhost:8080/cargocpc/index.html] for status using a timeout of [120000] ms...
[DEBUG] [URLDeployableMonitor] URL [http://localhost:8080/cargocpc/index.html] is not responding: 400 Cycle Detected
[DEBUG] [URLDeployableMonitor] Notifying monitor listener [org.codehaus.cargo.container.spi.deployer.DeployerWatchdog@a55f49]
[INFO] [yer.DeployerWatchdog] Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to start the Tomcat 6.x container.
Deployable [http://localhost:8080/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The …
Run Code Online (Sandbox Code Playgroud) maven-cargo ×10
maven ×6
java ×3
cargo ×2
maven-2 ×2
tomcat ×2
eclipse ×1
java-ee ×1
java-ee-7 ×1
java-ee-8 ×1
jetty ×1
log4j ×1
maven-plugin ×1
spring-mvc ×1
tomcat6 ×1
tomcat7 ×1
websphere ×1
websphere-8 ×1
wsadmin ×1