标签: maven-cargo

使用maven远程部署到WebSphere 8.5

我想控制maven生成的EAR的远程部署到未在构建服务器上运行的现有WAS实例.

理想情况下,我想在Maven中执行此操作,以便我可以在集成测试阶段进行远程部署,然后在验证阶段继续运行一些JMeters.我想这很标准.

我环顾四周,无法在WAS 8.5中找到合理的方法.

有几篇文章:

远程部署到WAS 6.1

websphere7am - Maven的插件

货物

和网络上的其他人,包括IBM.似乎没有提供实现远程部署到WAS 8.5的方法

有人有解决方案吗?

编辑1:IBM进一步确认没有正式的maven解决方案可以在这里找到:

WAS 8.5 - 使用Ant自动执行任务

websphere wsadmin maven-cargo maven websphere-8

14
推荐指数
1
解决办法
2万
查看次数

maven tomcat插件或货物插件?

Spring源代码示例使用maven tomcat插件,我可以使用命令运行这些项目mvn tomcat:run但是我没看到应用程序没有部署在本地tomcat服务器("C:\ apache tomcat\webapps \")中.

它与货物插件有何不同?(在这种情况下,当我运行命令时mvn cargo:redeploy,我看到部署在"C:\ apache tomcat\webapps \"位置的应用程序)

如果我将货物插件添加到弹簧示例的POM(如mvn-showcase,petclinic)..它会搞砸了吗?

maven-2 spring-mvc maven-cargo

10
推荐指数
1
解决办法
2411
查看次数

在Netbeans/Maven/Cargo插件中配置GlassFish 4域目录

我正在尝试使用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

maven-cargo java-ee maven java-ee-7 java-ee-8

10
推荐指数
1
解决办法
6358
查看次数

将自定义环境变量传递给maven货物

我正在寻找一种将环境变量传递到货物集装箱的方法.像这样的东西:

<plugin>
  <groupId>org.codehaus.cargo>
  <artifactId>cargo-maven2-plugin</artifactId>
  <configuration>
    <environmentVariables>
      <myCustomVariable>value</myCustomVariable>
      ...
Run Code Online (Sandbox Code Playgroud)

java environment-variables maven-cargo maven

8
推荐指数
1
解决办法
3359
查看次数

无法从货物部署到Tomcat7

我正在尝试通过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 …

maven-cargo tomcat7

8
推荐指数
1
解决办法
6030
查看次数

是否可以通过Maven Cargo插件提供Tomcat6的context.xml文件?

如果可能的话,我想将Tomcat的context.xml文件保留在WAR文件的META-INF目录之外.这可以用Maven的货物插件完成吗?我似乎找不到正确的配置.

tomcat cargo maven-cargo tomcat6 maven

7
推荐指数
1
解决办法
5429
查看次数

如何为Jetty的Maven Cargo插件指定jetty-env.xml文件?

我正在从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)

java maven-2 web-applications jetty maven-cargo

6
推荐指数
1
解决办法
3940
查看次数

如何覆盖Maven插件的log4j配置?

我正在使用Cargo Maven插件将WAR部署到远程服务器,我遇到了问题.我可能会为这个问题创建第二个问题,但是这个问题是关于覆盖Maven插件的log4j配置.Cargo使用JBoss的客户端库将东西发送到JBoss服务器(我正在尝试这样做.)JBoss库使用log4j.Cargo没有设置我所知道的任何类型的映射层.

因此,基本上,日志消息发生在Maven插件的依赖库中.我尝试设置-Dlog4j.debug并获取此信息:

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 …
Run Code Online (Sandbox Code Playgroud)

log4j cargo maven-cargo maven-plugin

6
推荐指数
1
解决办法
4420
查看次数

如何使用maven将我的Web应用程序和tomcat打包在一起?

我想将我的应用程序分发为嵌入在Apache Tomcat中的WAR.那就是我想要将Tomcat与我的应用程序一起分发.

如何使用Maven完成这种分发包装?

我见过Maven Cargo Plugin,但似乎是为了在本地容器中部署应用程序.也许我需要的是对Cargo插件的额外步骤.cargo:package似乎很有趣,但缺乏文档.

tomcat maven-cargo maven

5
推荐指数
1
解决办法
5110
查看次数

如何解决 org.codehaus.cargo.container.ContainerException

每当我通过 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)

java eclipse maven-cargo maven

5
推荐指数
1
解决办法
8987
查看次数