You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jd...@apache.org on 2005/05/04 05:14:36 UTC
svn commit: r168062 - in
/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean:
RepositoryCleaner.java discover/LegacyArtifactDiscoverer.java
Author: jdcasey
Date: Tue May 3 20:14:35 2005
New Revision: 168062
URL: http://svn.apache.org/viewcvs?rev=168062&view=rev
Log:
Cleaned up the sysout stuff to make the logs quieter when things are basically alright.
Modified:
maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java
maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java?rev=168062&r1=168061&r2=168062&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/RepositoryCleaner.java Tue May 3 20:14:35 2005
@@ -109,9 +109,9 @@
artifactDiscoverer = (ArtifactDiscoverer) container.lookup( ArtifactDiscoverer.ROLE,
configuration.getSourceRepositoryLayout() );
- if ( logger.isInfoEnabled() )
+ if ( logger.isDebugEnabled() )
{
- logger.info( "Discovering artifacts." );
+ logger.debug( "Discovering artifacts." );
}
try
@@ -129,6 +129,8 @@
catch ( Exception e )
{
repoReporter.error( "Error discovering artifacts in source repository.", e );
+
+ throw e;
}
}
@@ -170,9 +172,9 @@
targetRepositoryBase.getAbsolutePath(),
targetLayout );
- if ( logger.isInfoEnabled() )
+ if ( logger.isDebugEnabled() )
{
- logger.info( "Rewriting POMs and artifact files." );
+ logger.debug( "Rewriting POMs and artifact files." );
}
artifactIndexer.writeAritfactIndex( artifacts, targetRepositoryBase );
@@ -199,9 +201,9 @@
logger.error( "Error encountered while converting source repository to target repository." );
}
- if ( repoReporter.hasWarning() && logger.isWarnEnabled() )
+ if ( repoReporter.hasWarning() && logger.isDebugEnabled() )
{
- logger.warn(
+ logger.debug(
"Warning encountered while rewriting one or more artifacts from source repository to target repository." );
}
}
@@ -216,7 +218,7 @@
// if we wrote a repository report, and the configuration says to email the report, then do it.
if ( repoReporter.hasError() && configuration.mailErrorReport() )
{
- logger.info( "Sending error report to " + configuration.getErrorReportToName() + " via email." );
+ logger.debug( "Sending error report to " + configuration.getErrorReportToName() + " via email." );
MailMessage message = new MailMessage();
@@ -240,6 +242,8 @@
catch ( MailSenderException e )
{
logger.error( "An error occurred while trying to email repoclean report.", e );
+
+ throw e;
}
}
}
@@ -258,7 +262,7 @@
try
{
- logger.info( "Rewriting up to " + artifacts.size() + " artifacts (Should be " + ( artifacts.size() * 2 ) +
+ logger.debug( "Rewriting up to " + artifacts.size() + " artifacts (Should be " + ( artifacts.size() * 2 ) +
" rewrites including POMs)." );
int actualRewriteCount = 0;
@@ -408,9 +412,9 @@
}
catch ( Exception e )
{
- repoReporter.warn( "Rolling back conversion for: " + artifact );
if ( !configuration.force() )
{
+ repoReporter.warn( "Rolling back conversion for: " + artifact );
try
{
transaction.rollback();
@@ -420,6 +424,10 @@
repoReporter.error( "Error rolling back conversion transaction.", re );
}
}
+ else
+ {
+ repoReporter.warn( "NOT Rolling back conversion for: " + artifact + "; we are in --force mode." );
+ }
artifactReporter.error( "Error while rewriting file or POM for artifact: \'" + artifact.getId() +
"\'. See report at: \'" + artifactReportPath + "\'.", e );
@@ -528,11 +536,11 @@
File targetRepositoryBase = new File( targetRepositoryPath );
- logger.info( "Target repository is at: \'" + targetRepositoryBase + "\'" );
+ logger.debug( "Target repository is at: \'" + targetRepositoryBase + "\'" );
if ( !targetRepositoryBase.exists() )
{
- logger.info( "Creating target repository at: \'" + targetRepositoryBase + "\'." );
+ logger.debug( "Creating target repository at: \'" + targetRepositoryBase + "\'." );
targetRepositoryBase.mkdirs();
}
@@ -553,7 +561,7 @@
File sourceRepositoryBase = new File( sourceRepositoryPath );
- logger.info( "Source repository is at: \'" + sourceRepositoryBase + "\'" );
+ logger.debug( "Source repository is at: \'" + sourceRepositoryBase + "\'" );
if ( !sourceRepositoryBase.exists() )
{
@@ -591,7 +599,7 @@
}
else
{
- logger.info( "Creating reports directory: \'" + reportsBase + "\'" );
+ logger.debug( "Creating reports directory: \'" + reportsBase + "\'" );
reportsBase.mkdirs();
}
Modified: maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java?rev=168062&r1=168061&r2=168062&view=diff
==============================================================================
--- maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java (original)
+++ maven/components/trunk/sandbox/repoclean/src/main/java/org/apache/maven/tools/repoclean/discover/LegacyArtifactDiscoverer.java Tue May 3 20:14:35 2005
@@ -219,8 +219,8 @@
}
else
{
- getLogger().warn( "Cannot parse version from artifact path: \'" + path + "\'." );
- getLogger().info( "artifact-version-classifier-extension remaining tokens is: \'" + avceTokenList +
+ getLogger().debug( "Cannot parse version from artifact path: \'" + path + "\'." );
+ getLogger().debug( "artifact-version-classifier-extension remaining tokens is: \'" + avceTokenList +
"\'" );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org