gpt4 book ai didi

java - 使用 Ivy-Ant : Unauthorized by Credentials? 在 nexus 中发布工件

转载 作者:行者123 更新时间:2023-11-30 08:10:35 24 4
gpt4 key购买 nike

这是我的代码ivy.xml 文件

    <?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="nameOrganisation" module="nameModule" revision="1.0" status="release" publication="20150723102057">
</info>
<publications>
<artifact name="artifactName" type="jar" ext="jar"/>
</publications>
<dependencies>
<dependency org="org.springframework" name="spring-web-servlet" rev="3.0.5.RELEASE" transitive="false"/>
...

build.xml 文件

<target name="publish" description="Upload to Nexus">
<ivy:settings id="ivy.settings" file="${ivy.settings}">
<credentials host="host" realm="Sonatype Nexus Repository Manager" username="${repo.username}" passwd="${repo.password}"/>
</ivy:settings>
<ivy:retrieve />
<ivy:makepom ivyfile="${ivy.file}" pomfile="ivy.pom"/>
<ivy:publish resolver="publish" overwrite="true" publishivy="false" srcivypattern="${ivy.file}" settingsRef="ivy.settings" forcedeliver="true" organisation="organisation" module="nameModule" pubrevision="1.0" revision="1.0">
<artifacts pattern="${lib.app.dir}/[artifact](-[classifier]).[ext]"/>
</ivy:publish>

</target>

ivysettings-public.xml

<ivysettings>
<settings defaultResolver="nexus"/>
<!-- <credentials host="host" realm="Sonatype Nexus Repository Manager" username="user" passwd="pwd"/>-->
<resolvers>
<chain name="nexus">
<ibiblio name="name1" m2compatible="true" root="http://host:8080/nexus/content/repositories/name1/"/>
<ibiblio name="central" m2compatible="true" root="http://host:8080/nexus/content/repositories/name2/"/>

</chain>
</resolvers>
</ivysettings>

当我运行 build.xml 时,我总是得到相同的结果,它会忽略我的凭据吗?还是其他问题?

 buildPublish.xml:39: impossible to publish artifacts for     organisation#nameModule;1.0: java.io.IOException: Access to URL     [http://host:8080/nexus/content/repositories/name1/organisation/nameModule/1.0/n    ameModule-1.0.jar] was refused by the server: Unauthorized

我需要一些想法!!!谢谢

最佳答案

遇到了同样的问题。 4 小时后,我找到了解决方案。

我必须在我的凭据中分隔主机和端口:

<credentials 
host="${repo.host}"
port="${repo.port}"
realm="${repo.realm}"
username="${repo.username}"
passwd="${repo.password}"/>

关于java - 使用 Ivy-Ant : Unauthorized by Credentials? 在 nexus 中发布工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31583183/

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