dion 2003/08/20 21:28:25
Modified: src/java/org/apache/maven/verifier DependencyVerifier.java
Log:
System.out -> log
Checkstyle bits
Revision Changes Path
1.31 +23 -18 maven/src/java/org/apache/maven/verifier/DependencyVerifier.java
Index: DependencyVerifier.java
===================================================================
RCS file:
/home/cvs/maven/src/java/org/apache/maven/verifier/DependencyVerifier.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- DependencyVerifier.java 19 Aug 2003 04:31:38 -0000 1.30
+++ DependencyVerifier.java 21 Aug 2003 04:28:25 -0000 1.31
@@ -94,7 +94,7 @@
{
/** log for debug output */
private static final Log log = LogFactory.getLog(DependencyVerifier.class);
-
+
/** Control the use of timestamp comparison when downloading missing resources.
*/
private boolean useTimestamp = true;
@@ -107,7 +107,10 @@
/** Local Repository verifier. */
private LocalSettingsVerifier localRepositoryVerifier;
- /** Default ctor. */
+ /**
+ * Default ctor.
+ * @param project the project to verify
+ */
public DependencyVerifier( Project project )
{
super( project );
@@ -120,6 +123,7 @@
*
* @throws RepoConfigException If an error occurs while verifying basic maven
settings.
* @throws UnsatisfiedDependencyException If there are unsatisfied dependencies.
+ * @throws ChecksumVerificationException if the download checksum doesn't match
the calculated
*/
public void verify()
throws RepoConfigException,
@@ -159,19 +163,19 @@
// Is the user online?
boolean online = getProject().getContext().getOnline().booleanValue();
- if ( remoteRepoEnabled == false )
+ if ( !remoteRepoEnabled )
{
- System.out.println( getMessage( "remote.repository.disabled.warning" )
);
+ log.warn( getMessage( "remote.repository.disabled.warning" ) );
}
clearFailedDependencies();
- for ( Iterator i = getProject().getArtifacts().iterator(); i.hasNext(); )
+ for ( Iterator i = getProject().getArtifacts().iterator(); i.hasNext();)
{
Artifact artifact = (Artifact) i.next();
// The artifact plain doesn't exist so chalk it up as a failed
dependency.
- if ( artifact.exists() == false )
+ if ( !artifact.exists() )
{
failedDependencies.add( artifact );
}
@@ -191,14 +195,14 @@
}
else if ( !online && artifact.isSnapshot() )
{
- System.out.println( getMessage( "offline.snapshot.warning",
artifact.getName() ) );
+ log.warn( getMessage( "offline.snapshot.warning",
artifact.getName() ) );
}
}
}
// If we have any failed dependencies then we will attempt to download
// them for the user if the remote repository is enabled.
- if ( failedDependencies.isEmpty() == false
+ if ( !failedDependencies.isEmpty()
&& remoteRepoEnabled
&& online )
{
@@ -210,7 +214,7 @@
// also be a problem if the use of the remote repository has
// been disabled and dependencies just aren't present. In any
// case we have a problem.
- if ( failedDependencies.isEmpty() == false )
+ if ( !failedDependencies.isEmpty() )
{
throw new UnsatisfiedDependencyException(
createUnsatisfiedDependenciesMessage() );
}
@@ -236,7 +240,7 @@
message.append( "\n\n" );
- for ( Iterator i = failedDependencies.iterator(); i.hasNext(); )
+ for ( Iterator i = failedDependencies.iterator(); i.hasNext();)
{
Artifact artifact = (Artifact) i.next();
message.append( artifact.getName() );
@@ -274,7 +278,7 @@
*/
private void getDependencies()
{
- for ( Iterator i = failedDependencies.iterator(); i.hasNext(); )
+ for ( Iterator i = failedDependencies.iterator(); i.hasNext();)
{
Artifact artifact = (Artifact) i.next();
@@ -283,7 +287,7 @@
// before attempting to download the dependency.
File directory = artifact.getFile().getParentFile();
- if ( directory.exists() == false )
+ if ( !directory.exists() )
{
directory.mkdirs();
}
@@ -309,7 +313,7 @@
else
{
String warning = getMessage( "failed.download.warning",
artifact.getName() );
- System.err.println( warning );
+ log.warn( warning );
}
}
}
@@ -325,8 +329,8 @@
{
boolean artifactFound = false;
- for ( Iterator i =
getProject().getContext().getMavenRepoRemote().iterator(); i.hasNext(); )
- {
+ for ( Iterator i =
getProject().getContext().getMavenRepoRemote().iterator(); i.hasNext();)
+ {
String remoteRepo = (String) i.next();
// The username and password parameters are not being
@@ -358,6 +362,7 @@
// Multiple repositories may exist, and if the file is not found
// in just one of them, it's no problem.
// if it's not found at all, artifactFound will be false.
+ log.debug("File not found on one of the repos", e);
}
catch ( Exception e )
{
@@ -379,7 +384,7 @@
// 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);
+ log.warn("Error retrieving artifact from [" + url + "]: " + e);
}
}
@@ -399,7 +404,7 @@
private void verifyDependencies()
throws ChecksumVerificationException
{
- for ( Iterator i = getProject().getArtifacts().iterator(); i.hasNext(); )
+ for ( Iterator i = getProject().getArtifacts().iterator(); i.hasNext();)
{
Artifact artifact = (Artifact) i.next();
artifact.verify();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]