1

For a legacy project I'm currently introducing Ivy with Artifactory. I have some reusable scripts that work pretty well for jars and zips with sources. However, now I need to publish several large artifacts - zip-files, largest ~150MB. The publish fails with the following error-message:

impossible to publish artifacts for com.siemens.nucleus.tmbo#TMBO-RELEASE;1.6-SNAPSHOT: java.io.IOException: Error writing to server

Caused by: java.io.IOException: Error writing to server at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:578)

A workaround is to change the order of artifacts: small one first. It seems it has something to do with authentication - ivy seems to try with anonymous first, if that fails it tries with the configured user, but in the error case it only tries with anonymous, but twice (interpretation of Artifactory's access-log). I'd rather go with a solution than a workaround - any ideas? Can I force ivy to always use the credentials?

Here is my 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>

EDIT:

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 and ivy.repo.my-company.password are defined in a properties file %IVY-HOME%\security.properties

Community
  • 1
  • 1
Andy
  • 1,964
  • 1
  • 15
  • 29
  • What's in your ivysettings file? That is where credentials are configured – Mark O'Connor Jun 14 '13 at 22:09
  • See if this question helps: http://stackoverflow.com/questions/8505062/publish-snapshot-artifacts-to-maven-using-ivy-whats-the-magic – Mark O'Connor Jun 16 '13 at 15:32
  • @MarkO'Connor: please see my edit. Publish works for small files (like a charm for other modules with some jars), and I also tested authentication with good and bad users. – Andy Jun 17 '13 at 07:34
  • @MarkO'Connor: it seems my config is similar to the one you referenced (except for the maven stuff). – Andy Jun 17 '13 at 07:39

0 Answers0