From 21fff93ae99615373adbaf32b37f4d2835694a12 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Tue, 27 Oct 2009 14:32:07 +0000 Subject: [PATCH] [MNG-4408] Missing settings.xml is silently ignores git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@830204 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/maven/cli/MavenCli.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 2656861f37..6dca9565c1 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 @@ -518,6 +518,12 @@ public class MavenCli { userSettingsFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.ALTERNATE_USER_SETTINGS ) ); userSettingsFile = resolveFile( userSettingsFile, cliRequest.workingDirectory ); + + if ( !userSettingsFile.isFile() ) + { + throw new FileNotFoundException( "The specified user settings file does not exist: " + + userSettingsFile ); + } } else { @@ -532,6 +538,12 @@ public class MavenCli { globalSettingsFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.ALTERNATE_GLOBAL_SETTINGS ) ); globalSettingsFile = resolveFile( globalSettingsFile, cliRequest.workingDirectory ); + + if ( !globalSettingsFile.isFile() ) + { + throw new FileNotFoundException( "The specified global settings file does not exist: " + + globalSettingsFile ); + } } else {