Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0-alpha-2
-
None
-
None
Description
We have functional tests using the latest Maven snapshots and they started polluting the global ~/.m2/repository.
This commit introduced a bug in the handling of the local repository definition.
The local repository is taken from settings here.
but then, before, Maven was doing (in MavenCli)
String localRepoProperty = request.getUserProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY ); if ( localRepoProperty == null ) { localRepoProperty = request.getSystemProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY ); } if ( localRepoProperty != null ) { request.setLocalRepositoryPath( localRepoProperty ); }
effectively replacing the local repository definition only if `maven.repo.local` was defined in user or system properties.
After the commit mentioned above, the code does
request.setLocalRepositoryPath( determineLocalRepositoryPath( request ) ); ... private String determineLocalRepositoryPath( final MavenExecutionRequest request ) { return request.getUserProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY, request.getSystemProperties().getProperty( MavenCli.LOCAL_REPO_PROPERTY ) // null if not found ); }
effectively always replacing the local repository definition, potentially nulling it.
Attachments
Issue Links
- links to