mirror of https://github.com/apache/maven.git
avoid NPE when there is no project file
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163991 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
666c60dea6
commit
8e279f87e1
|
@ -112,7 +112,7 @@ public class PluginParameterExpressionEvaluator
|
|||
}
|
||||
else if ( expression.equals( "#basedir" ) )
|
||||
{
|
||||
value = context.getProject().getFile().getParentFile().getAbsolutePath();
|
||||
value = context.getProject().getBasedir().getAbsolutePath();
|
||||
}
|
||||
else if ( expression.startsWith( "#basedir" ) )
|
||||
{
|
||||
|
|
|
@ -132,7 +132,14 @@ public class MavenProject
|
|||
|
||||
public File getBasedir()
|
||||
{
|
||||
return getFile().getParentFile();
|
||||
if ( getFile() != null )
|
||||
{
|
||||
return getFile().getParentFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new File( System.getProperty( "user.dir" ) );
|
||||
}
|
||||
}
|
||||
|
||||
public void setDependencies( List denpendencies )
|
||||
|
|
Loading…
Reference in New Issue