对于一个遗留项目,我目前正在用 Artifactory 介绍 Ivy。我有一些可重用的脚本,它们非常适用于带有源的 jar 和 zip。但是,现在我需要发布几个大型工件- zip 文件,最大约 150MB。发布失败并显示以下错误消息:
无法为 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)
一种解决方法是更改工件的顺序:先小一个。它似乎与身份验证有关- 常春藤似乎首先尝试使用匿名,如果失败,它会尝试使用配置的用户,但在错误情况下它只尝试使用匿名,但是两次(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中定义