Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 大型工件的发布失败_Ant_Ivy_Artifactory - Fatal编程技术网

Ant 大型工件的发布失败

Ant 大型工件的发布失败,ant,ivy,artifactory,Ant,Ivy,Artifactory,对于一个遗留项目,我目前正在介绍Ivy和Artifactory。我有一些可重用的脚本,可以很好地用于jar和zip源代码。但是,现在我需要发布几个大型工件-zip文件,最大的~150MB。发布失败,并显示以下错误消息: 无法为com.siemens.nucleus.tmbo#tmbo-RELEASE发布工件;1.6-SNAPSHOT:java.io.IOException:写入服务器时出错 原因:java.io.IOException:在sun.net.www.protocol.http.Htt

对于一个遗留项目,我目前正在介绍Ivy和Artifactory。我有一些可重用的脚本,可以很好地用于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)处写入服务器时出错

解决方法是更改工件的顺序:首先是小工件它似乎与身份验证有关-ivy似乎首先尝试匿名,如果失败,它将尝试配置的用户,但在错误情况下,它只尝试匿名,但尝试两次(解释Artifactory的访问日志)。 我宁愿选择一个解决方案,而不是一个变通办法——有什么想法吗我可以强制ivy始终使用凭据吗?

这是我的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-HOME%\security.properties中定义了ivy.repo.my-company.username和ivy.repo.my-company.password?这就是配置凭据的地方如果这个问题有帮助,请参见:@MarkO'Connor:请查看我的编辑。Publish适用于小文件(就像其他带有JAR的模块的魅力一样),我还测试了好用户和坏用户的身份验证。@MarkO'Connor:看来我的配置与您引用的配置类似(除了maven的东西)。