【问题标题】:How use cargo-maven2-plugin deploy to jboss as5?如何使用 cargo-maven2-plugin 部署到 jboss as5?
【发布时间】:2011-03-15 10:24:50
【问题描述】:

我在尝试cargo-maven2-plugin,但我不在jboss5x中部署我的pom.xml是

<plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.0.2</version>
            <configuration>
                <container>
                    <containerId>jboss51x</containerId>
                    <home>E:\JavaWorkingTools\JBoss\jboss-5.1.0.GA</home>
                    <log>${basedir}/target/jboss5.1.x.logs/cargo.log</log>
                    <timeout>300000</timeout> <!-- 5 minutes -->
                    <systemProperties>
                        <jboss.server.log.threshold>INFO</jboss.server.log.threshold>
                    </systemProperties>
                </container>
                <configuration>
                    <type>existing</type>
                    <home>${project.build.directory}/target/jboss51x</home>
                    <properties>
                        <cargo.jvmargs>-XX:PermSize=512m -XX:MaxPermSize=1024
                            -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled
                            -XX:+CMSClassUnloadingEnabled</cargo.jvmargs>
                    </properties>
                </configuration>
                <deployer>
                    <type>installed</type>
                    <deployables>
                        <deployable>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>${project.artifactId}</artifactId>
                            <type>war</type>

                            <!--
                                <pingURL>http://localhost:8080/${artifactId}</pingURL>
                                <pingTimeout>300000</pingTimeout>
                            -->
                            <pingURL>http://localhost:8080/${project.artifactId}/index.jsp</pingURL>
                            <properties>
                                <context>/${project.artifactId}</context>
                            </properties>
                        </deployable>
                    </deployables>
                </deployer>
            </configuration>
            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>

我运行 cargo:deployer-start 或 cargodeployer-deploy 是错误的

cargo:deployer-start 错误信息是:

Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start (default-cli) on project SSH2Maven: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.0.2:deployer-start failed: Not supported -> [Help 1]

和 cargodeployer-deploy

The Deployable state is thus unknown. ->

我读了Deploying to a running container,但我不知道如何在 jboss5 中解聚 webapp :(

【问题讨论】:

    标签: maven-2 jboss jakarta-ee cargo maven-cargo


    【解决方案1】:

    您的配置有些奇怪。由于您使用的是已安装的现有容器,因此我希望看到其主目录的路径,而不是目标下的目录。这是我正在使用的配置:

      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.0.2</version>
        <configuration>
          <container>
            <containerId>jboss51x</containerId>
            <append>false</append>
            <log>${project.build.directory}/logs/jboss51x.log</log>
            <output>${project.build.directory}/logs/jboss51x.out</output>
            <timeout>300000</timeout><!-- 5 minutes -->
          </container>
          <configuration>
            <type>existing</type>
            <home>/path/to/jboss-5.1.0.GA</home>
            <properties>
              <cargo.servlet.port>8080</cargo.servlet.port>
              <cargo.jboss.configuration>default</cargo.jboss.configuration>
              <cargo.rmi.port>1099</cargo.rmi.port>
              <cargo.logging>high</cargo.logging>
            </properties>
            <deployables>
              <!-- application to deploy -->
              <deployable>
                <groupId>${project.groupId}</groupId>
                <artifactId>myapp</artifactId>
                <type>war</type>
                <!-- 
                <properties>
                  <context>acontext</context>
                </properties>
                -->
              </deployable>
            </deployables>
          </configuration>
        </configuration>
      </plugin>
    

    【讨论】:

    • 如果你第一次运行cargo:开始运行容器,第二次运行cargo:deployer-deploy在Jboss中部署webapp,最后输入地址localhost:8080/myapp/index.jsp,你可以访问吗?我按照上面的步骤,浏览器出现404
    • path home 我使用绝对路径
    猜你喜欢
    • 2011-03-22
    • 1970-01-01
    • 2011-08-05
    • 2012-02-02
    • 2010-11-26
    • 2011-08-02
    • 2011-01-17
    • 2012-03-15
    • 2012-11-14
    相关资源
    最近更新 更多