レガシー プロジェクトの場合、私は現在 Ivy with Artifactory を導入しています。ソース付きの jar や zip でうまく機能する再利用可能なスクリプトがいくつかあります。ただし、今はいくつかの大きな成果物を公開する必要があります-zip ファイル、最大 150 MB です。パブリッシュは、次のエラー メッセージで失敗します。
com.siemens.nucleus.tmbo#TMBO-RELEASE;1.6-SNAPSHOT: java.io.IOException: サーバーへの書き込みエラー
原因: java.io.IOException: sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:578) でサーバーへの書き込み中にエラーが発生しました
回避策は、アーティファクトの順序を変更することです: 小さいものを最初にします。認証と関係があるようです-アイビーは最初に匿名で試行するようです。それが失敗した場合は、構成されたユーザーで試行しますが、エラーの場合、匿名でのみ試行しますが、2回(Artifactoryのアクセスログの解釈)。回避策よりも解決策を考えたいと思います-何かアイデアはありますか? アイビーに常に資格情報を使用させることはできますか?
ここに私のivy.xmlがあります:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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="myorg"
module="mymodule"
revision="1.6-SNAPSHOT"
status="integration" />
<configurations>
<include file="${ivy.confs.file}" />
</configurations>
<publications>
<artifact name="large_artifact" ext="zip" type="deploy" />
<artifact name="small_artifact" ext="zip" type="deploy" />
</publications>
<dependencies>
<!-- None. -->
</dependencies>
</ivy-module>
編集:
ivysettings.xml:
<ivy-settings>
<settings defaultResolver="default" />
<include url="ivysettings-shared.xml" />
<include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
<resolvers>
<chain name="default" returnFirst="true" checkmodified="true">
<resolver ref="local" />
<resolver ref="shared" />
</chain>
</resolvers>
</ivy-settings>
ivysettings-shared.xml:
<ivy-settings>
<!--Authentication required for publishing (deployment). 'Artifactory Realm'
is the realm used by Artifactory so don't change it. -->
<credentials host="my-url.com" realm="Artifactory Realm"
username="${ivy.repo.my-company.username}" passwd="${ivy.repo.my-company.password}" />
<resolvers>
<chain name="shared">
<url name="my-releases" m2compatible="false">
<artifact
pattern="https://my-url.com/artifactory/my-releases/[organisation]/[module]/[revision]/[type]s/[artifact](-[classifier])-[revision].[ext]" />
<ivy
pattern="https://my-url.com/artifactory/my-releases/[organisation]/[module]/[revision]/[type]s/ivy-[revision].xml" />
</url>
<url name="my-snapshots" m2compatible="false">
<artifact
pattern="https://my-url.com/artifactory/my-snapshots/[organisation]/[module]/[revision]/[type]s/[artifact](-[classifier])-[revision].[ext]" />
<ivy
pattern="https://my-url.com/artifactory/my-snapshots/[organisation]/[module]/[revision]/[type]s/ivy-[revision].xml" />
</url>
<ibiblio name="my-external" m2compatible="true"
root="https://my-url.com/artifactory/all" />
</chain>
</resolvers>
</ivy-settings>
ivy.repo.my-company.usernameおよびivy.repo.my-company.passwordは、プロパティー・ファイル%IVY-HOME%\security.propertiesで定義されています