Skip to content

Commit

Permalink
Move determining the baseDirectory to DefaultMavenExecutionRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed May 24, 2020
1 parent 18ca544 commit 3c3ec2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public MavenExecutionRequest setPomFile( String pomFilename )
{
if ( pomFilename != null )
{
pom = new File( pomFilename );
this.setPom( new File( pomFilename ) );
}

return this;
Expand All @@ -687,6 +687,11 @@ public MavenExecutionRequest setPom( File pom )
{
this.pom = pom;

if ( this.pom != null && this.pom.getParentFile() != null )
{
this.setBaseDirectory( this.pom.getParentFile() );
}

return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1361,11 +1361,6 @@ private MavenExecutionRequest populateRequest( CliRequest cliRequest, MavenExecu
request.addActiveProfiles( profileActivation.activeProfiles );
request.addInactiveProfiles( profileActivation.inactiveProfiles );

if ( ( request.getPom() != null ) && ( request.getPom().getParentFile() != null ) )
{
request.setBaseDirectory( request.getPom().getParentFile() );
}

String localRepoProperty = request.getUserProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY );

if ( localRepoProperty == null )
Expand Down

0 comments on commit 3c3ec2d

Please sign in to comment.