从Jenkins部署Maven项目到JBoss AS 7.1.1 Final

时间:2014-08-29 14:28:19

标签: java deployment jboss jenkins

我已经下载了jenkins WAR的最新版本,并将其部署在JBoss AS 7.1.1 Final上。 我已经在jenkins上创建了一份新工作,并且我已经设置了SVN URL,这是我的Maven项目,我已经建立了它。 我希望jenkins在JBoss上自动部署我的项目生成的WAR,因为我安装了jenkins插件" Deploy Plugin"。 我跟踪错误:

ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to create deployer with implementation class org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer for the parameters (container [id = [jboss7x]], deployer type [remote]).
    at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:154)
    at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:93)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:141)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:161)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:61)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
    at hudson.FilePath.act(FilePath.java:917)
    at hudson.FilePath.act(FilePath.java:895)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1765)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:220)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:43)
    at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:150)
    ... 19 more
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:1375)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:156)
    ... 27 more
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:220)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:43)
    at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:150)
    at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:93)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:141)
    at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:161)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:61)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
    at hudson.FilePath.act(FilePath.java:917)
    at hudson.FilePath.act(FilePath.java:895)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1040)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1765)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
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:1375)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:156)
    ... 27 more
Finished: FAILURE 

感谢您的帮助! :)

1 个答案:

答案 0 :(得分:2)

您的插件似乎无法找到ModelControllerClient。它缺少对org.jboss.as:jboss-as-controller-client的依赖。

我应该推荐使用这个插件:https://docs.jboss.org/jbossas/7/plugins/maven/latest/ 因为我使用,我知道它有效。

看看如何配置它:https://docs.jboss.org/jbossas/7/plugins/maven/latest/examples/deployment-example.html