Skip to content

Commit

Permalink
decoupled project #file and #basedir to allow pom.xml processing
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
  • Loading branch information
ifedorenko committed Nov 26, 2014
1 parent 8643e00 commit c15226f
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public class MavenProject

private File file;

private File basedir;

private Set<Artifact> resolvedArtifacts;

private ArtifactFilter artifactFilter;
Expand Down Expand Up @@ -251,21 +253,24 @@ public File getFile()
}

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 )
Expand Down

0 comments on commit c15226f

Please sign in to comment.