使用IVY:发布任务以发布给公共Maven Repo-需要凭据



我正在尝试使用ivy:publish任务使用我理解的公共IBIBLIO解析器发布我的罐子,这与Maven Central存储库相对应。

这似乎有点工作,但是我最终得到了HTTP 405: Method Not Allowed

我的ivysettings.xmlivy.xmlbuild.xml文件的相关部分是:

ivysettings.xml

这实际上是整个文件:

<ivysettings>
    <settings defaultResolver="public"/>
        <resolvers>
            <ibiblio name="public" m2compatible="true" />
        </resolvers>
</ivysettings>

ivy.xml

...
<publications>
    <artifact type="pom" ext="pom" conf="default"/>
    <artifact type="jar" ext="jar" conf="default"/>
</publications>
...

build.xml

...
<target name="gen-pom" depends="ivy-resolve">
    <ivy:makepom ivyfile="ivy.xml" pomfile="${dist.dir}/${ant.project.name}.pom">
        <mapping conf="default" scope="compile"/>
    </ivy:makepom>
</target>
<target name="ivy-publish" depends="jar, gen-pom" description="publish jar/source to maven repo">
    <ivy:publish resolver="public" forcedeliver="true" overwrite="true" publishivy="false">
        <artifacts pattern="${dist.dir}/[artifact].[ext]" />
    </ivy:publish>
</target>
...

当我调用ant ivy-publish时,我会得到:

impossible to publish artifacts for mant-tasks#mant-tasks;1.0: java.io.IOException: PUT operation to URL https://repo1.maven.org/maven2/mant-tasks/mant-tasks/1.0/mant-tasks-1.0.pom failed with status code 405: Method Not Allowed

我想这是有道理的,否则任何人都可以污染命名空间。所以我的问题是:

  1. 这是由于我缺乏凭证吗?IE。我需要添加一个 我的credentials中的CC_7元素如下所示答案?
  2. 我可以为我的ibiblio获得凭据微不足道的模块,如果不是其他免费的公众存储库可向不想的Java开发人员使用构建和维护自己的Maven存储库?我需要能够从全球可用的存储库中拉出我的模块(作为其他项目的常春藤依赖性)。

Maven Central由Maven的创建者Sonatype操作:

  • http://central.sonatype.org/

JFrog运营一项名为Bintray的竞争服务:

  • https://bintray.com/

我建议阅读文档并获得凭证,该证书将允许发布您的模块的文件

最新更新