首页 > 解决方案 > jcenter上传jar文件失败:405代码

问题描述

我有以下build.gradle文件:

apply plugin:'java'
apply plugin:'groovy'
apply plugin:'eclipse'
apply plugin:'maven'

configurations {
  deployerJars
}

repositories{
  jcenter()
  mavenCentral()
}

version '0.1.2'
group 'io.example'

dependencies{
  implementation 'org.codehaus.groovy:groovy-all:2.4.10'    
  testImplementation 'org.spockframework:spock-core:1.0-groovy-2.4'      
}

dependencies{
  deployerJars "org.apache.maven.wagon:wagon-http:2.2"
}

uploadArchives {
  repositories.mavenDeployer {
    configuration = configurations.deployerJars
    repository( url:'https://my-private-repo.bintray.com' ){
      authentication userName:'myName', password:'secret' }
  }
}

如果我运行任务,我会遇到异常:

任务“:uploadArchives”执行失败。

无法发布配置“档案”

未能部署工件:无法传输工件......返回码是:405,ReasonPhrase:方法不允许。

我尝试使用maven-publish插件也没有运气。

我错过了什么?

标签: gradlegroovymaven-pluginjcenter

解决方案


推荐阅读