actually, you can specify a sys property instead

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2004-09-02 12:50:46 +00:00
parent c13e8c7629
commit 063a7ef0f6
1 changed files with 16 additions and 6 deletions

View File

@ -142,13 +142,25 @@ public class MBoot
File userPomFile = new File( System.getProperty( "user.home" ), ".m2/pom.xml" );
reader = new ModelReader();
if ( !reader.parse( userPomFile ) )
if ( userPomFile.exists() && !reader.parse( userPomFile ) )
{
System.err.println( "Error reading user POM file" );
System.exit( 1 );
}
String mavenRepoLocal = System.getProperty( "maven.repo.local", reader.getLocal().getRepository() );
if ( mavenRepoLocal == null )
{
System.out.println( "You must have a ~/.m2/pom.xml file and must contain the following entries:" );
System.out.println( "<local>\n" );
System.out.println( " <repository>/path/to/m2/repository</repository> (required)\n" );
System.out.println( " <online>true</online> (optional)\n" );
System.out.println( "<local>" );
System.out.println( " <repository>/path/to/m2/repository</repository> (required)" );
System.out.println( " <online>true</online> (optional)" );
System.out.println( "</local>" );
System.out.println();
System.out.println( "Alternatively, you can specify -Dmaven.repo.local=/path/to/m2/repository" );
System.exit( 1 );
}
@ -184,8 +196,6 @@ public class MBoot
online = false;
}
String mavenRepoLocal = System.getProperty( "maven.repo.local", reader.getLocal().getRepository() );
downloader = new ArtifactDownloader( mavenRepoLocal, reader.getRemoteRepositories() );
repoLocal = downloader.getMavenRepoLocal().getPath();