错误405:方法不允许Maven默认存储库

时间:2016-07-23 00:23:26

标签: java eclipse maven maven-3

我试图使用mvn deploy在maven上发布我的项目,但似乎我遇到了问题......我没有个人存储库而我想要将我的回购发布到maven中央存储库但没有取得多大成功...

错误是:

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project telegram: Failed to deploy artifacts: Could not transfer artifact ...jar... from/to central (https://repo1.maven.org/maven2/): Failed to transfer file: ...jar.... Return code is: 405, ReasonPhrase: Method Not Allowed. 

对不起,如果错误的格式不是特别好,但我希望它足够好。

我的pom看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd">     4.0.0

<groupId>id</groupId>
<artifactId>id</artifactId>
<version>version</version>

<dependencies>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20140107</version>
    </dependency>
</dependencies>

<distributionManagement>
    <repository>
        <id>central</id>
        <name>Central Repository</name>
        <url>https://repo1.maven.org/maven2/</url>
        <layout>default</layout>
    </repository>
</distributionManagement>

<pluginRepositories>
    <pluginRepository>
        <id>central</id>
        <name>Central Repository</name>
        <url>https://repo1.maven.org/maven2/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <updatePolicy>never</updatePolicy>
        </releases>
    </pluginRepository>
</pluginRepositories>

1 个答案:

答案 0 :(得分:0)

这可能不是您遇到的问题,但我注意到在维护窗口期间也可能出现无用的 405 Not Allowed 错误消息。在浏览器中访问暂存部署 URL 时:https://oss.sonatype.org/service/local/staging/deploy/maven2,

然后会出现一条更有用的错误消息:

<块引用>

维护期间不允许的方法。