FAQ

[Ivy-user] Newbie: Can't configure Ivy from local file in Windows

Lewis, Eric
Aug 8, 2008 at 9:26 am
Hi

I'm new to Ivy and like it a lot :-) (I'm using 2.0.0-beta2)
I'm trying to create a new general build, which consists of a general
'build.xml' file in the directory 'build', which is then included and
called in every project.

I'm trying to add the java.net repo to Ivy and followed the instructions
on the site.

This means that my project has the following build file:
<project name="xyz" default="rebuild" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="project.version" value="1.0.5" />
<property name="build.dir" location="../../build" />
<import file="${build.dir}/project/build.xml"/>
</project>

And in the general 'build.xml' file, I have
...

<target name="init">
...

<ivy:settings file="${build.dir}/global/ivysettings.xml" />
<ivy:retrieve file="ivy.xml" />

<ivy:cachepath pathid="lib.path" conf="default" />
<path id="lib.path.test">
<path refid="lib.path" />
<path location="${classes.main.dir}" />
</path>

</target>
...

So the settings are in the 'build' directory, and the 'ivy.xml' file is
in the project directory.

However, when I start the build, I get

init:
[ivy:settings] :: Ivy 2.0.0-beta2 - 20080225093827 ::
http://ant.apache.org/ivy/ ::
[ivy:settings] :: loading settings :: file =
C:\jp\build\global\ivysettings.xml

BUILD FAILED
C:\jp\build\project\build.xml:16: impossible to configure ivy:settings
with given file: C:\jp\build\global\ivysettings.xml
:java.text.ParseException: failed to load settings from
file:/C:/jp/build/global/ivysettings.xml: io problem while parsing
config file: unknown protocol: c


I must be doing something wrong, but can't figure it out...

Any help is really appreciated :-)

Best regards,
Eric

P.S. Or perhaps there's a simpler way to just add a repository to the
default public repositories?
reply

Search Discussions

6 responses

  • Maarten Coene at Aug 8, 2008 at 2:42 pm
    Could you please post your settings.xml file?

    Maarten




    ----- Original Message ----
    From: "Lewis, Eric" <Eric.Lewis@ipi.ch>
    To: ivy-user@ant.apache.org
    Sent: Friday, August 8, 2008 11:25:39 AM
    Subject: Newbie: Can't configure Ivy from local file in Windows

    Hi

    I'm new to Ivy and like it a lot :-) (I'm using 2.0.0-beta2)
    I'm trying to create a new general build, which consists of a general
    'build.xml' file in the directory 'build', which is then included and
    called in every project.

    I'm trying to add the java.net repo to Ivy and followed the instructions
    on the site.

    This means that my project has the following build file:
    <project name="xyz" default="rebuild" basedir="."
    xmlns:ivy="antlib:org.apache.ivy.ant">
    <property name="project.version" value="1.0.5" />
    <property name="build.dir" location="../../build" />
    <import file="${build.dir}/project/build.xml"/>
    </project>

    And in the general 'build.xml' file, I have
    ...

    <target name="init">
    ...

    <ivy:settings file="${build.dir}/global/ivysettings.xml" />
    <ivy:retrieve file="ivy.xml" />

    <ivy:cachepath pathid="lib.path" conf="default" />
    <path id="lib.path.test">
    <path refid="lib.path" />
    <path location="${classes.main.dir}" />
    </path>

    </target>
    ...

    So the settings are in the 'build' directory, and the 'ivy.xml' file is
    in the project directory.

    However, when I start the build, I get

    init:
    [ivy:settings] :: Ivy 2.0.0-beta2 - 20080225093827 ::
    http://ant.apache.org/ivy/ ::
    [ivy:settings] :: loading settings :: file =
    C:\jp\build\global\ivysettings.xml

    BUILD FAILED
    C:\jp\build\project\build.xml:16: impossible to configure ivy:settings
    with given file: C:\jp\build\global\ivysettings.xml
    :java.text.ParseException: failed to load settings from
    file:/C:/jp/build/global/ivysettings.xml: io problem while parsing
    config file: unknown protocol: c


    I must be doing something wrong, but can't figure it out...

    Any help is really appreciated :-)

    Best regards,
    Eric

    P.S. Or perhaps there's a simpler way to just add a repository to the
    default public repositories?
  • Lewis, Eric at Aug 8, 2008 at 3:33 pm
    Ok:

    <ivy-module version="1.0">
    <ivysettings>
    <settings defaultResolver="default" />
    <include file="C:/jp/build/global/build-ivysettings-public.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />
    </ivysettings>
    </ivy-module>


    I copied it from the default configuration, just to change the public configuration.
    The first include also didn't work, with the same error.

    Best regards,
    Eric
    -----Ursprüngliche Nachricht-----
    Von: Maarten Coene
    Gesendet: Freitag, 8. August 2008 16:42
    An: ivy-user@ant.apache.org
    Betreff: Re: Newbie: Can't configure Ivy from local file in Windows

    Could you please post your settings.xml file?

    Maarten




    ----- Original Message ----
    From: "Lewis, Eric" <Eric.Lewis@ipi.ch>
    To: ivy-user@ant.apache.org
    Sent: Friday, August 8, 2008 11:25:39 AM
    Subject: Newbie: Can't configure Ivy from local file in Windows

    Hi

    I'm new to Ivy and like it a lot :-) (I'm using 2.0.0-beta2)
    I'm trying to create a new general build, which consists of a general
    'build.xml' file in the directory 'build', which is then included and
    called in every project.

    I'm trying to add the java.net repo to Ivy and followed the
    instructions
    on the site.

    This means that my project has the following build file:
    <project name="xyz" default="rebuild" basedir="."
    xmlns:ivy="antlib:org.apache.ivy.ant">
    <property name="project.version" value="1.0.5" />
    <property name="build.dir" location="../../build" />
    <import file="${build.dir}/project/build.xml"/>
    </project>

    And in the general 'build.xml' file, I have
    ...

    <target name="init">
    ...

    <ivy:settings file="${build.dir}/global/ivysettings.xml" />
    <ivy:retrieve file="ivy.xml" />

    <ivy:cachepath pathid="lib.path" conf="default" />
    <path id="lib.path.test">
    <path refid="lib.path" />
    <path location="${classes.main.dir}" />
    </path>

    </target>
    ...

    So the settings are in the 'build' directory, and the
    'ivy.xml' file is
    in the project directory.

    However, when I start the build, I get

    init:
    [ivy:settings] :: Ivy 2.0.0-beta2 - 20080225093827 ::
    http://ant.apache.org/ivy/ ::
    [ivy:settings] :: loading settings :: file =
    C:\jp\build\global\ivysettings.xml

    BUILD FAILED
    C:\jp\build\project\build.xml:16: impossible to configure ivy:settings
    with given file: C:\jp\build\global\ivysettings.xml
    :java.text.ParseException: failed to load settings from
    file:/C:/jp/build/global/ivysettings.xml: io problem while parsing
    config file: unknown protocol: c


    I must be doing something wrong, but can't figure it out...

    Any help is really appreciated :-)

    Best regards,
    Eric

    P.S. Or perhaps there's a simpler way to just add a repository to the
    default public repositories?



  • Jing Xue at Aug 8, 2008 at 11:56 pm

    On Fri, Aug 08, 2008 at 05:32:52PM +0200, Lewis, Eric wrote:
    Ok:

    <ivy-module version="1.0">
    <ivysettings>
    <settings defaultResolver="default" />
    <include file="C:/jp/build/global/build-ivysettings-public.xml" />
    Try:

    <include url="file://C:/jp/build/global/build-ivysettings-public.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
    <include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />
    </ivysettings>
    </ivy-module>


    I copied it from the default configuration, just to change the public configuration.
    The first include also didn't work, with the same error.

    Best regards,
    Eric
  • Lewis, Eric at Aug 11, 2008 at 7:29 am
    I just tried this with another Ant tag:

    <ivy:settings file="C:/jp/build/global/ivysettings.xml" />

    This works, even though I don't know why it didn't before.


    Using an URL with

    <ivy:settings url="file://C:/jp/build/global/ivysettings.xml" />

    gives me

    BUILD FAILED
    C:\jp\build\project\build.xml:29: impossible to configure ivy:settings with given url :file://C:/jp/build/global/ivysettings.xml :java.io.IOException: Server returned HTTP response code: 502 for URL: ftp://C/jp/build/global/ivysettings.xml

    No idea, why Ivy thinks that file:// is the same as ftp://

    The same happens for the URL

    <ivy:settings url="file://C/jp/build/global/ivysettings.xml" />


    Best regards,
    Eric

    -----Ursprüngliche Nachricht-----
    Von: Jing Xue
    Gesendet: Samstag, 9. August 2008 01:28
    An: ivy-user@ant.apache.org
    Betreff: Re: Newbie: Can't configure Ivy from local file in Windows

    On Fri, Aug 08, 2008 at 05:32:52PM +0200, Lewis, Eric wrote:
    Ok:

    <ivy-module version="1.0">
    <ivysettings>
    <settings defaultResolver="default" />
    <include
    file="C:/jp/build/global/build-ivysettings-public.xml" />

    Try:

    <include
    url="file://C:/jp/build/global/build-ivysettings-public.xml" />
    <include
    url="${ivy.default.settings.dir}/ivysettings-shared.xml" />
    <include
    url="${ivy.default.settings.dir}/ivysettings-local.xml" />
    <include
    url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
    <include
    url="${ivy.default.settings.dir}/ivysettings-default-chain.xml" />
    </ivysettings>
    </ivy-module>


    I copied it from the default configuration, just to change
    the public configuration.
    The first include also didn't work, with the same error.

    Best regards,
    Eric
  • Niklas Matthies at Aug 11, 2008 at 8:07 am
    On Mon 2008-08-11 at 09:28h, Lewis, Eric wrote on ivy-user:
    :
    Using an URL with

    <ivy:settings url="file://C:/jp/build/global/ivysettings.xml" />
    Technically this is not correct, as the "C:" here is the host part of
    the URL (the general form of a file URL being "file://host/path").
    You might have better luck with "file:///C:/...", which basically
    means "file://localhost/C:/...". It might be that in the above the ":"
    in "C:" is taken as a user/password separator, which somehow is taken
    to mean FTP (as in "ftp://user:password@host/path").

    -- Niklas Matthies
  • Lewis, Eric at Aug 11, 2008 at 8:11 am
    Ok, I tried

    <ivy:settings url="file:///C:/jp/build/global/ivysettings.xml" />

    and it works, indeed. Thanks!

    (It now also works with file="...")
    -----Ursprüngliche Nachricht-----
    Von: Niklas Matthies
    Gesendet: Montag, 11. August 2008 10:05
    An: ivy-user@ant.apache.org
    Betreff: Re: Newbie: Can't configure Ivy from local file in Windows

    On Mon 2008-08-11 at 09:28h, Lewis, Eric wrote on ivy-user:
    :
    Using an URL with

    <ivy:settings url="file://C:/jp/build/global/ivysettings.xml" />
    Technically this is not correct, as the "C:" here is the host part of
    the URL (the general form of a file URL being "file://host/path").
    You might have better luck with "file:///C:/...", which basically
    means "file://localhost/C:/...". It might be that in the above the ":"
    in "C:" is taken as a user/password separator, which somehow is taken
    to mean FTP (as in "ftp://user:password@host/path").

    -- Niklas Matthies

Related Discussions

Discussion Navigation
viewthread | post