ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Tharp <joshua-th...@alumni.calpoly.edu>
Subject Configurations and Ivy file confusion
Date Tue, 21 Apr 2009 23:19:22 GMT
Serious ivy newbie alert

I am utterly baffled by the configuration mechanism with Ivy. If I leave
everything in the default configuration things work pretty much as I would
expect. However, I'm trying to set up one of my modules to be used only as a
build tool in another (i.e. I don't want it to be part of the second
module's delivery).

I have one module called antlib that contains my build tool:
antlib/ivy.xml
<?xml version="1.0" encoding="UTF-8"?>
<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="com.mycompany.tools"
    module="antlib">
  <description>
    A collection of ant scripts that are pieced together for an actual
build.
  </description>
</info>
</ivy-module>

Now I only want this module to be used as part of the build in another
module, not transitive. So I thought I could declare a configuration in my
other Ivy file that used the first.
dfm/ivy.xml
<?xml version="1.0" encoding="UTF-8"?>
<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="com.mycompany.dfm"
    module="dfm">
  <description>The DFM</description>
</info>

<configurations>
  <conf
      name="default"
      visibility="public" />
  <conf
      name="antlib"
      visibility="private" />
</configurations>

<dependencies>
  <dependency
      org="com.mycompany.tools"
      name="antlib"
      rev="0.3.+"
      conf="antlib" />
</dependencies>

</ivy-module>

When I build and deploy antlib on my PC then everything seems to work fine.
However, when I have my CruiseControl system publish antlib then my
configured resolver errors out on the shared one.
ivysettings.xml
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
  <settings defaultResolver="default" />

  <property
      name="ivy.local.default.root"
      value="${ivy.default.ivy.user.dir}/local"
      override="false" />
  <property
      name="ivy.local.default.ivy.pattern"
      value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
      override="false" />
  <property
      name="ivy.local.default.artifact.pattern"
      value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
      override="false" />

  <property
      name="repo.root"
      value="http://internal.system/repository" />
  <property
      name="module.pat"
      value="[organisation]/[module]/[revision]" />
  <property
      name="ivy.pat"
      value="ivy-[revision].xml" />
  <property
      name="artifact.pat"
      value="[module]-[revision].[ext]" />

  <resolvers>
    <filesystem
        name="local"
        checkmodified="true"
        changingMatcher="regexp"
        changingPattern=".*_SNAPSHOT">
      <ivy
pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
      <artifact
pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
    </filesystem>

    <url name="shared">
      <ivy pattern="${repo.root}/${module.pat}/${ivy.pat} "/>
      <artifact pattern="${repo.root}/${module.pat}/${artifact.pat}" />
    </url>

    <filesystem
        name="shared-repository"
        local="true">
      <ivy pattern="${ivy.publish.d}/${module.pat}/${ivy.pat} "/>
      <artifact pattern="${ivy.publish.d}/${module.pat}/${artifact.pat}" />
    </filesystem>
  </resolvers>

  <include url="${ivy.default.settings.dir}/ivysettings-public.xml" />
  <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml" />
  <include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"
/>
</ivysettings>

I use the shared-repository resolver to publish the artifacts with my
CruiseControl setup and use the shared one to get them back out on my PC.

I've poured through the configurations, default configurations, and inline
configurations documentation... I must be missing something pretty basic
here.

Here is the part of my build script that is calling Ivy
      <ivy:settings
          file="${my.ivy.settings.file}"
          id="ivy.instance" />

      <ivy:info />

      <ivy:retrieve
          conf="antlib"
          pattern="${lib.d}/antlib.jar" />

Here is the error I get when I try to resolve against the repository.
[ivy:retrieve]  public: no ivy file nor artifact found for
com.mycompany.tools#antlib;0.3.+
[ivy:retrieve]  found com.mycompany.tools#antlib;0.3.11 in shared
[ivy:retrieve]  [0.3.11] com.mycompany.tools#antlib;0.3.+
[ivy:retrieve]  resolved ivy file produced in C:\Documents and
Settings\jlt\.ivy2\cache\resolved-com.mycompany.dfm-dfm-working@Hawk.xml
[ivy:retrieve] :: downloading artifacts ::
[ivy:retrieve] :: resolution report :: resolve 437ms :: artifacts dl 0ms

---------------------------------------------------------------------
        |                  |            modules            ||   artifacts
|
        |       conf       | number| search|dwnlded|evicted||
number|dwnlded|

---------------------------------------------------------------------
        |      antlib      |   1   |   0   |   0   |   0   ||   0   |   0
|

---------------------------------------------------------------------
[ivy:retrieve] WARN:    ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] WARN:    ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve] WARN:    ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] WARN:    :: com.mycompany.tools#antlib;0.3.11: configuration
not found in com.mycompany.tools#antlib;0.3.11: 'antlib'. It was required
from com.mycompany.dfm#dfm;working@Hawk antlib
[ivy:retrieve] WARN:    ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]  report for com.mycomany.dfm#dfm;working@Hawk antlib produced
in C:\Documents and
Settings\jlt\.ivy2\cache\com.mycompany.dfm-dfm-antlib.xml
[ivy:retrieve]  resolve done (437ms resolve - 0ms download)
[ivy:retrieve]
[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]          :: com.mycompany.tools#antlib;0.3.11: configuration
not found in com.mycompany.tools#antlib;0.3.11: 'antlib'. It was required
from com.mycompany.dfm#dfm;working@Hawk antlib
[ivy:retrieve]          ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]
[ivy:retrieve]
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
   [subant] Exiting C:\Documents and Settings\jlt\.ant\bootstrap.xml.

BUILD FAILED
D:\co\dfm\cc-boot-build.xml:21: The following error occurred while executing
this line:
C:\Documents and Settings\jlt\.ant\bootstrap.xml:12: The following error
occurred while executing this line:
jar:file:/C:/Documents%20and%20Settings/jlt/.ant/lib/bootstrap.jar!/com/mycompany/bootstrap/antlib.xml:38:
impossible to resolve dependencies:
        resolve failed - see output for details
        at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
... lots more stack trace...

Thanks for your time,

Josh

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message