[英]ivy (2.3.0 or 2.4) not resolving SNAPSHOT maven dependency with a classifier
我無法使用ivy-2.3.0和nexus / maven 2存儲庫解決SNAPSHOT依賴項。
我嘗試了幾件事,但還是失敗了,
此部分已修復:請在評論部分中查看我的評論。
我得到的最新輸出是maven:classifier沒有與元素關聯。 為此,我需要填寫名稱空間映射,並且不確定如何為分類器部件尋找maven和ivy。
我的關系正在使用時間戳。
我的項目文件
<project
name="test"
xmlns:ivy="antlib:org.apache.ivy.ant"
>
<ivy:settings file="ivysettings.xml" />
<ivy:retrieve pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" />
.....
我的ivysettings文件:
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<!-- what should I put here for maven and ivy to use classifier? -->
<namespace name="test">
<rule>
<fromsystem>
<src org="systemorg"/>
<dest org="A"/>
</fromsystem>
<tosystem>
<src org="A"/>
<dest org="systemorg"/>
</tosystem>
</rule>
</namespace>
<credentials host="nexus"
realm="Sonatype Nexus Repository Manager"
username="xyz" passwd="xyz"/>
<property name="libs_snapshot"
value="http://nexus.host.com/nexus/content/repositories/libs_snapshot"/>
<property
name="version_pattern"
value="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
/>
<settings defaultResolver="repos" />
<resolvers>
<chain name="repos">
<ibiblio name="central" m2compatible="true"/>
<ibiblio
name="libs_snapshot"
m2compatible="true"
pattern="${version_pattern}"
root="${libs_snapshot}"
/>
</chain>
</resolvers>
</ivysettings>
我的ivy.xml文件:
<ivy-module version='2.0' xmlns:m="http://ant.apache.org/ivy/maven">
<info
organisation="com.xyz"
module="chained-resolvers"
/>
<dependencies>
<dependency
org="com.xyz"
name="cache_store"
rev="1.1-SNAPSHOT"
changing="true"
>
<artifact name="cache_store"
m:classifier="mobile"
type="jar" ext="jar"/>
</dependency>
</dependencies>
</ivy-module>
盡管我收到錯誤消息說常春藤無法解決依賴關系,但實際上還是出現HTTP 401錯誤,表明我未經授權。
通過使用參數“ -debug”運行ant任務,可以揭示真正的原因。
HTTP response status: 401 url=
CLIENT ERROR: Unauthorized url=
我添加了安全憑證,但是我輸入的內容似乎有問題:
這個沒有用,解決了我遇到的問題:
<credentials
host="server"
realm="Sonatype Nexus Repository Manager"
username="username" passwd="password"
/>
這個工作了:
<credentials
host="server.xyz.com"
realm="Sonatype Nexus Repository Manager"
username="username" passwd="password"
/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.