首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用gradle和maven-publish时,我无法找到支持所请求协议的旅行车: scp

在使用gradle和maven-publish时,我无法找到支持所请求协议的旅行车: scp
EN

Stack Overflow用户
提问于 2015-06-03 03:14:33
回答 1查看 769关注 0票数 0

我得到的错误是- "“属性uploadURL被定义为scp://user@host/data/apps/repo/m2”“以下是相关部分

代码语言:javascript
复制
configurations {
    deployerJars
}
// Apply the java plugin to add support for Java
apply plugin: 'java'
//----------------------
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'net.researchgate:gradle-release:2.0.2'
    }
}
//----------------------
apply plugin: 'maven'
uploadArchives {
    repositories {
        mavenDeployer {
            //uploadURL is defined in a properties file. It is properly recognied
            //by gradle
            repository(url:upLoadURL) 
            uniqueVersion = false
        }

    }
}
//----------------------
apply plugin: 'net.researchgate.release'


//----------------------
// In this section you declare where to find the dependencies of your project
repositories {
    // Use 'maven central' for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    mavenCentral()
}

// In this section you declare the dependencies for your production and test code
dependencies {
    deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"

    compile 'org.springframework:spring-context:4.1.6.RELEASE'
    compile 'org.springframework:spring-webmvc:4.1.6.RELEASE'


    // Declare the dependency for your favourite test framework you want to use in your tests.
    // TestNG is also supported by the Gradle Test task. Just change the
    // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
    // 'test.useTestNG()' to your build script.

    testCompile 'junit:junit:4.11'


}
EN

回答 1

Stack Overflow用户

发布于 2016-06-01 23:49:11

您创建了一个不必要的名为deployJars的配置。

您缺少archives configurationwagon依赖项

代码语言:javascript
复制
dependencies {
    archives "org.apache.maven.wagon:wagon-ssh-external:3.4.0"
}

因此,将deployJars更改为archives

然后对于uploadArchives,您需要指定配置:

代码语言:javascript
复制
uploadArchives {
    repositories {
        mavenDeployer {
            configuration = configurations.archives // <-- missing
            repository(url: "scpexe://yourhost/yourdir/") 
            uniqueVersion = false
        }

    }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30604678

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档