如何将CARGO指向要在JBoss 7上部署的Jar文件。*?

时间:2016-05-14 15:14:16

标签: jenkins deployment jboss cargo

当我尝试部署我的应用程序时,这是Jenkins的控制台输出:

Caused by: org.codehaus.cargo.util.CargoException: Cannot locate the JBoss     connector classes! Make sure the required JBoss JARs (or Maven dependencies) are    in CARGO's classpath.
    More information on: http://cargo.codehaus.org/JBoss+Remote+Deployer
at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>   (JBoss5xRemoteDeployer.java:161)
at org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer.<init>(JBoss7xRemoteDeployer.java:41)
... 26 more
Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:156)
... 27 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

这是关于我的POM档案中的CARGO的内容。

<plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.2.0</version>
            <configuration>
                <container>
                    <containerId>jboss7x</containerId>
                    <type>remote</type>
                </container>
            </configuration>
            <executions>
                <execution>
                    <id>deploy</id>
                    <phase>install</phase>
                    <goals>
                        <goal>redeploy</goal>
                    </goals>
                    <configuration>
                        <type>runtime</type>
                        <properties>
                            <cargo.hostname>localhost</cargo.hostname>
                            <cargo.jboss.management.port>19999</cargo.jboss.management.port>
                        </properties>
                    </configuration>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-controller-client</artifactId>
                    <version>7.1.1.Final</version>
                </dependency>
            </dependencies>
        </plugin>

我已经尝试过我在网上找到的所有其他解决方案,但没有一个能够解决问题。有什么想法吗?

2 个答案:

答案 0 :(得分:0)

您的类加载器似乎无法找到jboss-as-controller-client,即使它被定义为插件依赖项。

您可以尝试将jboss-as-controller-client定义为项目依赖项。如果问题仍然存在,那么尝试将jboss-as-controller-client jar添加到使用的java的classpath中。

答案 1 :(得分:0)

我通过将所有jar文件从JBoss modules文件夹复制到jenkins / plugins / deploy / WEB-INF来解决了这个问题。