Stop retrieve if resolving a dependency fails
---------------------------------------------
Key: IVY-642
URL: https://issues.apache.org/jira/browse/IVY-642
Project: Ivy
Issue Type: Improvement
Components: Core
Affects Versions: 2.0.0-alpha-2
Reporter: John Rasmussen
In a setup, where a dependency can build a module from source, it is useful to
stop the retrieve at once if compilation errors show up.
By allowing source builds cause that the retrieve process is a time consuming
process and resolve errors are only shown when the process eventually completes.
See more at
http://www.nabble.com/How-to-halt-on-an-unresolved-dependency-t4717519.html
Looking into the code it does not seem too nice to introduce a new Exception to
throw from
org.apache.ivy.plugins.repository.AbstractRepository.getResource(String)
- the IOException already thrown from getResource is catched and turned into a
RuntimeException in RepositoryResolve.findResourceUsingPattern
being catched (as Exception) at IvyNode.loadData(), which returns false and
finally via VisitNode ends in ResolveEngine, where the loop for the next
dependency is.
Another idea is to add an option to ResolveOptions (which is to be set in
ivysettings.xml) to stop resolve if any dependency fails.
This option should be passed to the methods
ResolveEngine.fetchDependencies(VisitNode, String, boolean) and
ResolveEngein.doFetchDependencies(VisitNode, String)
which bails out if VisitNode.loadData returns false (which is the return value
from IvyNode.loadData, which returns false on any Exception)
The second solution has less granularity - always stop on error.
In a setup where all dependencies should be found, it is ok to stop the
process immediately if anything fails.
I'm not sure about the best solution.
I might have missed some details in the ResolveEngine code.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.