dion 2003/02/09 06:37:53
Modified: src/java/org/apache/maven/verifier DependencyVerifier.java
Log:
PR: MAVEN-246
Submitted by: Colin Sampaleanu
Reviewed by: dIon Gillard
Slightly different version of the code to Colin's patch. Should have the same logic,
use less return statements and be easier to read.
Revision Changes Path
1.17 +18 -13
jakarta-turbine-maven/src/java/org/apache/maven/verifier/DependencyVerifier.java
Index: DependencyVerifier.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/verifier/DependencyVerifier.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DependencyVerifier.java 3 Feb 2003 23:06:18 -0000 1.16
+++ DependencyVerifier.java 9 Feb 2003 14:37:53 -0000 1.17
@@ -63,7 +63,6 @@
import org.apache.maven.util.HttpUtils;
import java.io.File;
-import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -323,25 +322,31 @@
// in case there is a newer version (i.e. snapshots) in another
repo
artifactFound = true;
}
- catch ( FileNotFoundException e )
+ catch ( Exception e )
{
// If there are additional remote repos, then ignore exception
// as artifact may be found in another remote repo. If there
// are no more remote repos to check and the artifact wasn't found
in
- // a previous remote repo, then return false indicating
+ // a previous remote repo, then artifactFound is false indicating
// that the artifact could not be found in any of the remote repos
- if ( !i.hasNext() && !artifactFound)
- {
- return false;
- }
- }
- catch ( Exception e )
- {
- return false;
+ //
+ // arguably, we need to give the user better control
(another command-
+ // line switch perhaps) of what to do in this case?
Maven already has
+ // a command-line switch to work in offline mode, but
what about when
+ // one of two or more remote repos is unavailable?
There may be multiple
+ // remote repos for redundancy, in which case you
probably want the build
+ // to continue. There may however be multiple remote
repos because some
+ // artifacts are on one, and some are on another. In
this case, you may
+ // want the build to break.
+ //
+ // print a warning, in any case, so user catches on to
mistyped
+ // hostnames, or other snafus
+ // FIXME: localize this message
+ System.out.println("Error retrieving artifact from ["
+ url + "]: " + e);
}
}
- return true;
+ return artifactFound;
}
// ----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]