0

我有一个基于 gradle 的项目,我正在使用货物将战争部署到 tomcat7。在另一个基于 Maven 的项目中,我完全能够部署。我在我的 Mac 上运行这些项目。唯一的区别是在 Maven 项目中,这是配置:

<configuration>
    <warFile>${basedir}/target/${project.build.finalName}.war</warFile>
    <url>http://localhost:8080/manager</url>
    <server>TomcatServer</server>
    <path>/mypath</path>
</configuration>

但是在 gradle 中,cargo 部署到 localhost:8080/manager/text,我认为这就是我得到 403 的原因。相同的构建文件在我的 ubuntu 上运行得非常好。

这是我的 build.gradle:

apply plugin: 'cargo'

repositories {
    mavenCentral()
}

buildscript {
    repositories {
        add(new org.apache.ivy.plugins.resolver.URLResolver()) {
            name = 'GitHub'
            addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
        }
    }
    dependencies {
         classpath 'bmuschko:gradle-cargo-plugin:0.3'
    }
}

cargo {
    containerId = 'tomcat7x'
    port = 8080
    context = 'mypath'
    remote {
        hostname = 'localhost'
        username = 'username'
        password = 'passwd'
    }
}

dependencies {
    cargo 'org.codehaus.cargo:cargo-core-uberjar:1.1.1',
          'org.codehaus.cargo:cargo-ant:1.1.1',
          'jaxen:jaxen:1.1.1'
}

在我的 tomcat-users.xml 中,我包含了经理、经理脚本和经理 GUI 角色。我在这里错过了什么吗?

4

0 回答 0