gpt4 book ai didi

maven - 将 gradle 与 maven-publish 一起使用时,出现无法找到支持请求的协议(protocol) : scp 的 wagon

转载 作者:行者123 更新时间:2023-12-03 05:15:52 24 4
gpt4 key购买 nike

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

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'


}

最佳答案

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

您缺少 wagon archives 的依赖关系configuration :

dependencies {
archives "org.apache.maven.wagon:wagon-ssh-external:3.4.0"
}

所以改变 deployJarsarchives .

然后为 uploadArchives ,你需要指定配置:
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.archives // <-- missing
repository(url: "scpexe://yourhost/yourdir/")
uniqueVersion = false
}

}
}

关于maven - 将 gradle 与 maven-publish 一起使用时,出现无法找到支持请求的协议(protocol) : scp 的 wagon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30604678/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com