From c66610a6e4ff95a54149ce508b31971f7549be5b Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 5 Oct 2005 20:43:06 +0000 Subject: [PATCH] Resolving: MNG-1056...Added code to reconstruct the remote artifact repository list after the project has had profiles applied. This was already done for plugin repositories. Also, added null protection to DefaultLog per Chris Berry's suggestion. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@295111 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/monitor/logging/DefaultLog.java | 28 +++++++++++++------ .../project/DefaultMavenProjectBuilder.java | 6 ++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java b/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java index 331fcde49f..189edef33a 100644 --- a/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java +++ b/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java @@ -35,12 +35,24 @@ public class DefaultLog public void debug( CharSequence content ) { - logger.debug( content.toString() ); + logger.debug( toString( content ) ); + } + + private String toString( CharSequence content ) + { + if ( content == null ) + { + return ""; + } + else + { + return content.toString(); + } } public void debug( CharSequence content, Throwable error ) { - logger.debug( content.toString(), error ); + logger.debug( toString( content ), error ); } public void debug( Throwable error ) @@ -50,12 +62,12 @@ public class DefaultLog public void info( CharSequence content ) { - logger.info( content.toString() ); + logger.info( toString( content ) ); } public void info( CharSequence content, Throwable error ) { - logger.info( content.toString(), error ); + logger.info( toString( content ), error ); } public void info( Throwable error ) @@ -65,12 +77,12 @@ public class DefaultLog public void warn( CharSequence content ) { - logger.warn( content.toString() ); + logger.warn( toString( content ) ); } public void warn( CharSequence content, Throwable error ) { - logger.warn( content.toString(), error ); + logger.warn( toString( content ), error ); } public void warn( Throwable error ) @@ -80,12 +92,12 @@ public class DefaultLog public void error( CharSequence content ) { - logger.error( content.toString() ); + logger.error( toString( content ) ); } public void error( CharSequence content, Throwable error ) { - logger.error( content.toString(), error ); + logger.error( toString( content ), error ); } public void error( Throwable error ) diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 6d319d213c..2b1e6b075f 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -676,8 +676,10 @@ public class DefaultMavenProjectBuilder "\'.\n\n Reason(s):\n" + validationResult.render( " " ) ); } - project.setRemoteArtifactRepositories( remoteRepositories ); - + project.setRemoteArtifactRepositories( ProjectUtils.buildArtifactRepositories( model.getRepositories(), + artifactRepositoryFactory, + container ) ); + // TODO: these aren't taking active project artifacts into consideration in the reactor project.setPluginArtifacts( createPluginArtifacts( project.getBuildPlugins() ) ); project.setReportArtifacts( createReportArtifacts( project.getReportPlugins() ) );