mirror of https://github.com/apache/maven.git
[MNG-3168] Correct error message when project descriptor not found
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@902614 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a7cf185920
commit
046666a715
|
@ -336,7 +336,7 @@ public class DefaultMaven
|
|||
|
||||
// We have no POM file.
|
||||
//
|
||||
if ( request.getPom() == null || !request.getPom().exists() )
|
||||
if ( request.getPom() == null )
|
||||
{
|
||||
ModelSource modelSource = new UrlModelSource( getClass().getResource( "project/standalone.xml" ) );
|
||||
MavenProject project =
|
||||
|
|
|
@ -807,28 +807,24 @@ public class MavenCli
|
|||
|
||||
if ( alternatePomFile != null )
|
||||
{
|
||||
request.setPom( resolveFile( new File( alternatePomFile ), workingDirectory ) );
|
||||
File pom = resolveFile( new File( alternatePomFile ), workingDirectory );
|
||||
|
||||
request.setPom( pom );
|
||||
}
|
||||
else if ( request.getPom() != null && !request.getPom().isAbsolute() )
|
||||
else
|
||||
{
|
||||
request.setPom( request.getPom().getAbsoluteFile() );
|
||||
File pom = modelProcessor.locatePom( baseDirectory );
|
||||
|
||||
if ( pom.isFile() )
|
||||
{
|
||||
request.setPom( pom );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( request.getPom() != null ) && ( request.getPom().getParentFile() != null ) )
|
||||
{
|
||||
request.setBaseDirectory( request.getPom().getParentFile() );
|
||||
}
|
||||
else if ( ( request.getPom() == null ) && ( request.getBaseDirectory() != null ) )
|
||||
{
|
||||
File pom = modelProcessor.locatePom( new File( request.getBaseDirectory() ) );
|
||||
|
||||
request.setPom( pom );
|
||||
}
|
||||
// TODO: Is this correct?
|
||||
else if ( request.getBaseDirectory() == null )
|
||||
{
|
||||
request.setBaseDirectory( new File( System.getProperty( "user.dir" ) ) );
|
||||
}
|
||||
|
||||
if ( commandLine.hasOption( CLIManager.RESUME_FROM ) )
|
||||
{
|
||||
|
@ -887,7 +883,7 @@ public class MavenCli
|
|||
}
|
||||
else
|
||||
{
|
||||
return new File( workingDirectory, file.getPath() );
|
||||
return new File( workingDirectory, file.getPath() ).getAbsoluteFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue