[cargo.remote.username]和[cargo.remote.password]属性是必需的,需要在配置中定义

cfh9epnr  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(298)

我正在尝试使用jenkins将我的项目部署到tomcat服务器,我正在使用脚本管道。我已经安装了部署到容器插件。我添加的用户是tomcat-users.xml

<role rolename="manager-script"/>
   <role rolename="manager-gui"/>
   <user username="deployer" password="deployer" roles="manager-script,manager-gui"/>

这是我编写的groovy脚本的一部分

stage('Deploy')
    {
        steps{
            deploy adapters: [tomcat8(credentialsId:'deployer', path: '', url: 'http://localhost:8080/')], contextPath: 'hr_login', onFailure: false, war: '**/*.war'
            echo "Project deployed";
        }
    }

但该项目尚未部署。堆栈跟踪如下所示:

org.codehaus.cargo.container.ContainerException: The [cargo.remote.username] and [cargo.remote.password] properties are mandatory and need to be defined in your configuration.
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.createManager(AbstractTomcatManagerDeployer.java:287)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.getTomcatManager(AbstractTomcatManagerDeployer.java:82)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:161)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
at hudson.FilePath.act(FilePath.java:1164)
at hudson.FilePath.act(FilePath.java:1147)
at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:99)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

我是Jenkins的新手。请帮忙。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题