mirror of https://github.com/apache/maven.git
o Fixed lazy repo creation to cache result repo
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1021505 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
947973e857
commit
f5ad9a458a
|
@ -1843,6 +1843,8 @@ public class MavenProject
|
|||
}
|
||||
|
||||
protected ArtifactRepository getReleaseArtifactRepository()
|
||||
{
|
||||
if ( releaseArtifactRepository == null )
|
||||
{
|
||||
if ( getDistributionManagement() != null && getDistributionManagement().getRepository() != null )
|
||||
{
|
||||
|
@ -1850,13 +1852,19 @@ public class MavenProject
|
|||
{
|
||||
ArtifactRepository repo =
|
||||
repositorySystem.buildArtifactRepository( getDistributionManagement().getRepository() );
|
||||
repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(), Arrays.asList( repo ) );
|
||||
repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
setReleaseArtifactRepository( repo );
|
||||
}
|
||||
catch ( InvalidRepositoryException e )
|
||||
{
|
||||
if ( logger != null )
|
||||
{
|
||||
logger.debug( "Failed to create release distribution repository for " + getId(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1864,6 +1872,8 @@ public class MavenProject
|
|||
}
|
||||
|
||||
protected ArtifactRepository getSnapshotArtifactRepository()
|
||||
{
|
||||
if ( snapshotArtifactRepository == null )
|
||||
{
|
||||
if ( getDistributionManagement() != null && getDistributionManagement().getSnapshotRepository() != null )
|
||||
{
|
||||
|
@ -1871,13 +1881,19 @@ public class MavenProject
|
|||
{
|
||||
ArtifactRepository repo =
|
||||
repositorySystem.buildArtifactRepository( getDistributionManagement().getSnapshotRepository() );
|
||||
repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(), Arrays.asList( repo ) );
|
||||
repositorySystem.injectProxy( projectBuilderConfiguration.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
repositorySystem.injectAuthentication( projectBuilderConfiguration.getRepositorySession(),
|
||||
Arrays.asList( repo ) );
|
||||
setSnapshotArtifactRepository( repo );
|
||||
}
|
||||
catch ( InvalidRepositoryException e )
|
||||
{
|
||||
if ( logger != null )
|
||||
{
|
||||
logger.debug( "Failed to create snapshot distribution repository for " + getId(), e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue