mirror of https://github.com/apache/maven.git
decoupled project #file and #basedir to allow pom.xml processing
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
This commit is contained in:
parent
8643e00993
commit
c15226f13f
|
@ -101,6 +101,8 @@ public class MavenProject
|
|||
|
||||
private File file;
|
||||
|
||||
private File basedir;
|
||||
|
||||
private Set<Artifact> resolvedArtifacts;
|
||||
|
||||
private ArtifactFilter artifactFilter;
|
||||
|
@ -251,21 +253,24 @@ public class MavenProject
|
|||
}
|
||||
|
||||
public void setFile( File file )
|
||||
{
|
||||
this.file = file;
|
||||
this.basedir = file != null ? file.getParentFile() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets project {@code file} without changing project {@code basedir}.
|
||||
*
|
||||
* @since 3.2.4
|
||||
*/
|
||||
public void setPomFile( File file )
|
||||
{
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public File getBasedir()
|
||||
{
|
||||
if ( getFile() != null )
|
||||
{
|
||||
return getFile().getParentFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
// repository based POM
|
||||
return null;
|
||||
}
|
||||
return basedir;
|
||||
}
|
||||
|
||||
public void setDependencies( List<Dependency> dependencies )
|
||||
|
|
Loading…
Reference in New Issue