Hi Guillaume,
although this is often true, there are some plugins which create their own
local repository, for instance maven-invoker-plugin and
maven-dependency-plugin. In those cases you should pass the
ArtifactRepository.
So we will need those versions too, either as overloaded method or
restored where artifactRepository can be null.
thanks,
Robert
On Sat, 08 Oct 2016 20:43:58 +0200, <gb...@apache.org> wrote:
Author: gboue
Date: Sat Oct 8 18:43:58 2016
New Revision: 1763929
URL: http://svn.apache.org/viewvc?rev=1763929&view=rev
Log:
[MSHARED-595] In DefaultProjectInstaller, the path to the local
repository should be retrieved from the RepositoryManager
We need to rely on the RepositoryManager to get a hold of the local
repository base directory.
Modified:
maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java
Modified:
maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java
URL:
http://svn.apache.org/viewvc/maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java?rev=1763929&r1=1763928&r2=1763929&view=diff
==============================================================================
---
maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java
(original)
+++
maven/shared/trunk/maven-artifact-transfer/src/main/java/org/apache/maven/shared/project/install/internal/DefaultProjectInstaller.java
Sat Oct 8 18:43:58 2016
@@ -101,7 +101,7 @@ public class DefaultProjectInstaller
{
installer.install( buildingRequest,
Collections.<Artifact>singletonList(
new ProjectArtifact( project ) ) );
- installChecksums( buildingRequest, artifactRepository,
artifact, createChecksum );
+ installChecksums( buildingRequest, artifact,
createChecksum );
addMetaDataFilesForArtifact( artifactRepository,
artifact, metadataFiles, createChecksum );
}
}
@@ -120,7 +120,7 @@ public class DefaultProjectInstaller
if ( file != null && file.isFile() )
{
installer.install( buildingRequest,
Collections.<Artifact>singletonList( artifact ) );
- installChecksums( buildingRequest, artifactRepository,
artifact, createChecksum );
+ installChecksums( buildingRequest, artifact,
createChecksum );
addMetaDataFilesForArtifact( artifactRepository,
artifact, metadataFiles, createChecksum );
}
else if ( !attachedArtifacts.isEmpty() )
@@ -139,7 +139,7 @@ public class DefaultProjectInstaller
for ( Artifact attached : attachedArtifacts )
{
installer.install( buildingRequest,
Collections.singletonList( attached ) );
- installChecksums( buildingRequest, artifactRepository,
attached, createChecksum );
+ installChecksums( buildingRequest, attached, createChecksum
);
addMetaDataFilesForArtifact( artifactRepository, attached,
metadataFiles, createChecksum );
}
@@ -153,12 +153,12 @@ public class DefaultProjectInstaller
* the original POM file (cf. MNG-2820). While the plugin currently
requires Maven 2.0.6, we continue to hash the
* installed POM for robustness with regard to future changes like
re-introducing some kind of POM filtering.
*
+ * @param buildingRequest The project building request, must not be
<code>null</code>.
* @param artifact The artifact for which to create checksums, must
not be <code>null</code>.
* @param createChecksum {@code true} if checksum should be
created, otherwise {@code false}.
* @throws IOException If the checksums could not be installed.
*/
- private void installChecksums( ProjectBuildingRequest
buildingRequest, ArtifactRepository artifactRepository,
- Artifact artifact, boolean
createChecksum )
+ private void installChecksums( ProjectBuildingRequest
buildingRequest, Artifact artifact, boolean createChecksum )
throws IOException
{
if ( !createChecksum )
@@ -166,7 +166,7 @@ public class DefaultProjectInstaller
return;
}
- File artifactFile = getLocalRepoFile( buildingRequest,
artifactRepository, artifact );
+ File artifactFile = getLocalRepoFile( buildingRequest, artifact
);
installChecksums( artifactFile );
}
@@ -257,14 +257,14 @@ public class DefaultProjectInstaller
* Gets the path of the specified artifact within the local
repository. Note that the returned path need not exist
* (yet).
*
+ * @param buildingRequest The project building request, must not be
<code>null</code>.
* @param artifact The artifact whose local repo path should be
determined, must not be <code>null</code>.
* @return The absolute path to the artifact when installed, never
<code>null</code>.
*/
- private File getLocalRepoFile( ProjectBuildingRequest
buildingRequest, ArtifactRepository artifactRepository,
- Artifact artifact )
+ private File getLocalRepoFile( ProjectBuildingRequest
buildingRequest, Artifact artifact )
{
String path = repositoryManager.getPathForLocalArtifact(
buildingRequest, artifact );
- return new File( artifactRepository.getBasedir(), path );
+ return new File( repositoryManager.getLocalRepositoryBasedir(
buildingRequest ), path );
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org