You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Xavier Hanin <xa...@gmail.com> on 2008/02/27 10:43:55 UTC

Ivy settings ant error

Hi,

In latest Ivy version we have changed the way to load settings, using a task
instead of a datatype, but still using an id attribute. The code of the task
is available here:
https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java

A user is complaining (see forwarded e-mail) about a warning message from
Ant:
Warning: Reference ivy.instance has not been set at runtime, but was
found during
build file parsing, attempting to resolve. Future versions of Ant may
support
referencing ids defined in non-executed targets.

Any idea what can be wrong? Is it related to our implementation of the
settings task? Any help from Ant gurus would be welcome :-)

Xavier



---------- Forwarded message ----------
From: Neil Lott <ne...@yahoo.com>
Date: Sun, Feb 24, 2008 at 6:03 PM
Subject: ant error
To: Ivy User User <iv...@ant.apache.org>


I have multiple build.xml files that each import a common.xml file.

I also have a productbuild.xml file that imports the common.xml file
and makes antcalls on sets of build.xml files.

When I run my individual module build.xml everything works fine.

When I run my productbuild.xml file that makes antcall's to each
build.xml I see the following error:

Warning: Reference ivy.instance has not been set at runtime, but was
found during
build file parsing, attempting to resolve. Future versions of Ant may
support
referencing ids defined in non-executed targets.

Each build.xml will call the following macrodef regardless of whether
the build.xml file is executed standalone or from an antcall from the
productbuild.xml

       <macrodef name="ivy-init">
               <attribute name="ivy.file"/>
               <attribute name="ivy.lib.dir"/>
               <sequential>
                       <ivy:resolve file="@{ivy.file}"/>
                       <ivy:retrieve pattern="@{ivy.lib.dir}/[conf]/
[artifact]-[revision].[ext]" symlink="true"/>
               </sequential>
  </macrodef>

Since my ivy setting file doesn't change I make this call once in my
initialization target.

<target name="common-init">
....
               <ivy:settings id="ivy.instance" file="${ivy.settings.file}"
override="true"/>
</target>


Since we have a large project I have it so my common-init target is
called once when the product build.xml is started and then the
build.xmls are smart enough not to call it again.  But if I'm just
running my build.xml standalone then the build.xml knows to call
common-init target.

Here's the full ant log with verbose calling a build.xml file from the
productbuild.xml via an antcall


Warning: Reference ivy.instance has not been set at runtime, but was
found during
build file parsing, attempting to resolve. Future versions of Ant may
support
referencing ids defined in non-executed targets.
[ivy:settings] Loading jar:file:/Users/neil/Business/
SnowyRangeConsulting/projects/twc/thirdparty/apache-ant-1.7.0/lib/
ivy.jar!/org/apache/ivy/core/settings/ivy.properties
Override ignored for property "ivy.log.modules.in.use"
Override ignored for property "ivy.resolver.default.check.modified"
Override ignored for property "ivy.default.always.check.exact.revision"
Override ignored for property "ivy.retrieve.pattern"
Override ignored for property "ivy.configurations"
Override ignored for property "ivy.buildlist.ivyfilepath"
Override ignored for property "ivy.status"
Override ignored for property "ivy.resolve.default.type.filter"
Override ignored for property "ivy.project.dir"
Override ignored for property "ivy.dep.file"
Override ignored for property "ivy.settings.file"
Override ignored for property "ivy.report.output.pattern"
Override ignored for property "ivy.cache.ttl.default"
Override ignored for property "ivy.publish.src.artifacts.pattern"
Override ignored for property "ivy.deliver.ivy.pattern"
Override ignored for property "ivy.build.artifacts.dir"
Override ignored for property "ivy.checksums"
Override ignored for property "ivy.distrib.dir"
Override ignored for property "ivy.lib.dir"
[ivy:settings] :: loading settings :: file = /Users/neil/Business/
SnowyRangeConsulting/projects/twc/depot/server/releases/main-ivy/ivy-
settings.xml
[ivy:settings] settings loaded (8ms)
[ivy:settings]  default cache: /Users/neil/Business/
SnowyRangeConsulting/projects/twc/thirdparty/ivy/cache
[ivy:settings]  default resolver: chained
[ivy:settings]  -- 3 resolvers:
[ivy:settings]  chained [chain] [local, shared]
[ivy:settings]  local [file]
[ivy:settings]  shared [ssh]
[ivy:resolve] using ivy parser to parse file:/Users/neil/Business/
SnowyRangeConsulting/projects/twc/depot/server/releases/main-ivy/share/
db/ivyif.xml
[ivy:resolve] :: resolving dependencies :: twc#mas-dbif;working@
flicker.local
[ivy:resolve]   confs: [interface]
[ivy:resolve]   validate = true
[ivy:resolve]   refresh = false





-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Re: Ivy settings ant error

Posted by Steve Loughran <st...@apache.org>.
Xavier Hanin wrote:
> Hi,
> 
> In latest Ivy version we have changed the way to load settings, using a task
> instead of a datatype, but still using an id attribute. The code of the task
> is available here:
> https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyAntSettings.java
> 
> A user is complaining (see forwarded e-mail) about a warning message from
> Ant:
> Warning: Reference ivy.instance has not been set at runtime, but was
> found during
> build file parsing, attempting to resolve. Future versions of Ant may
> support
> referencing ids defined in non-executed targets.
> 
> Any idea what can be wrong? Is it related to our implementation of the
> settings task? Any help from Ant gurus would be welcome :-)


It means they define the ivy.instance type or whatever in a target that 
has not been executed; it is not in the dependency graph. Ant finds the 
definition anyway, then tells you off for being naughty

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org