对于遗留项目,我目前正在介绍Ivy with Artifactory。我有一些可重复使用的脚本,可以很好地用于包含源的罐子和拉链。但是,现在我需要发布几个大型工件 - 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)
解决方法是先更改工件的顺序:小工具。 它似乎与身份验证有关 - ivy似乎首先尝试使用匿名,如果失败则尝试使用已配置的用户,但在错误情况下它只会尝试匿名,但两次(解释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