From 4c2d75b72674df08d111abcb9c0d05bb4cb8f279 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Thu, 8 Nov 2007 06:44:26 +0000 Subject: [PATCH] Moving offline notice to avoid embedded cases. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@593040 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/maven/cli/MavenCli.java | 5 +++++ .../java/org/apache/maven/embedder/MavenEmbedder.java | 9 +++++++++ .../execution/DefaultMavenExecutionRequestPopulator.java | 2 -- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 6dd7d05e7e..936e09acd0 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -168,6 +168,11 @@ public class MavenCli mavenEmbedder = new MavenEmbedder( configuration ); logger = mavenEmbedder.getLogger(); + + if ( mavenEmbedder.isOffline( request ) ) + { + logger.info( "You are working in offline mode." ); + } } catch ( MavenEmbedderException e ) { diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java index e71a0d6904..7168b57b1a 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java @@ -778,6 +778,15 @@ public class MavenEmbedder // Start of new embedder API // ---------------------------------------------------------------------- + public boolean isOffline( MavenExecutionRequest request ) + throws MavenEmbedderException + { + // first, grab defaults including settings, in case true is set. + request = populator.populateDefaults( request, configuration ); + + return request.isOffline(); + } + public MavenExecutionResult execute( MavenExecutionRequest request ) { LoggerManager loggerManager = container.getLoggerManager(); diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java index f67ebc0154..3c73307c42 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java @@ -470,8 +470,6 @@ public class DefaultMavenExecutionRequestPopulator if ( request.isOffline() ) { - getLogger().info( "You are working in offline mode." ); - wagonManager.setOnline( false ); } else