[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ivy-dev
Subject:    How to halt on an unresolved dependency
From:       "John Rasmussen" <johnrasmussendk () gmail ! com>
Date:       2007-10-30 8:39:30
Message-ID: 871937e20710300139x5822bb8di10c9aafee57b2236 () mail ! gmail ! com
[Download RAW message or body]

I have extended org.apache.ivy.plugins.repository.AbstractRepository
in order to build modules directly from source.
If any of the module/source contains compilation errors, I like the
resolve process to stop.

In method Resource getResource(String source) of AbstractRepository, I
have tried calling fireTransferError, throwing an IOException and
returning a Resource.exists = false. Thus Ivy knows the module is
unresolved but Ivy continues resolving the next dependencies.
Because resolving a dependency can involve building source, it gets
time consuming to wait for the resolve process to complete all the
dependencies - no errors are written until the process completes.
That's why I want to stop when the first dependency fails.
Well, one solution is to call System.exit, but like
org.apache.ivy.util.Message() is not flushed, so this is not the best
solution.

Normally, Ivy should continue resolving dependencies (as it does), but
in this case, I like a way to halt.
IvyResolve.isHaltonfailure() is only read after all the dependencies
have been resolved.

I have tried Ivy 1.4.1 and 2.0.0-alpha2 but not found a way to halt on
an unresolved dependency.

Summary: Are there a "nice" way to stop the resolve process when
failing to resolve a dependency?

Regards
   John Rasmussen
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic