maven-3.0.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven30RepositoryManager.java [63:116]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.repositorySystem = Objects.requireNonNull( repositorySystem );
    }

    @Override
    public String getPathForLocalArtifact( ProjectBuildingRequest buildingRequest,
                                           org.apache.maven.artifact.Artifact mavenArtifact )
    {
        Artifact aetherArtifact = RepositoryUtils.toArtifact( mavenArtifact );

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact(
                aetherArtifact );
    }

    @Override
    public String getPathForLocalArtifact( ProjectBuildingRequest buildingRequest,
                                           ArtifactCoordinate coordinate )
    {
        Artifact aetherArtifact = toArtifact( coordinate );

        // LRM.getPathForLocalArtifact() won't throw an Exception, so translate reflection error to RuntimeException

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact(
                aetherArtifact );
    }

    @Override
    public String getPathForLocalMetadata( ProjectBuildingRequest buildingRequest,
                                           ArtifactMetadata metadata )
    {
        Metadata aetherMetadata = new DefaultMetadata( metadata.getGroupId(),
                metadata.storedInGroupDirectory() ? null : metadata.getArtifactId(),
                metadata.storedInArtifactVersionDirectory() ? metadata.getBaseVersion() : null, "maven-metadata.xml",
                Nature.RELEASE_OR_SNAPSHOT );

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalMetadata(
                aetherMetadata );
    }

    @Override
    public ProjectBuildingRequest setLocalRepositoryBasedir( ProjectBuildingRequest buildingRequest,
                                                             File basedir )
    {
        ProjectBuildingRequest newRequest = new DefaultProjectBuildingRequest( buildingRequest );

        RepositorySystemSession session = buildingRequest.getRepositorySession();

        // "clone" session and replace localRepository
        DefaultRepositorySystemSession newSession = new DefaultRepositorySystemSession( session );

        // Clear cache, since we're using a new local repository
        newSession.setCache( new DefaultRepositoryCache() );

        // keep same repositoryType
        String repositoryType = resolveRepositoryType( session.getLocalRepository() );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



maven-3.1.x/src/main/java/org/apache/maven/shared/transfer/repository/internal/Maven31RepositoryManager.java [61:114]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.repositorySystem = Objects.requireNonNull( repositorySystem );
    }

    @Override
    public String getPathForLocalArtifact( ProjectBuildingRequest buildingRequest,
                                           org.apache.maven.artifact.Artifact mavenArtifact )
    {
        Artifact aetherArtifact = RepositoryUtils.toArtifact( mavenArtifact );

        // LRM.getPathForLocalArtifact() won't throw an Exception, so translate reflection error to RuntimeException

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact(
                aetherArtifact );
    }

    @Override
    public String getPathForLocalArtifact( ProjectBuildingRequest buildingRequest,
                                           ArtifactCoordinate coordinate )
    {
        Artifact aetherArtifact = toArtifact( coordinate );

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalArtifact(
                aetherArtifact );
    }

    @Override
    public String getPathForLocalMetadata( ProjectBuildingRequest buildingRequest,
                                           ArtifactMetadata metadata )
    {
        Metadata aetherMetadata = new DefaultMetadata( metadata.getGroupId(),
                metadata.storedInGroupDirectory() ? null : metadata.getArtifactId(),
                metadata.storedInArtifactVersionDirectory() ? metadata.getBaseVersion() : null, "maven-metadata.xml",
                Nature.RELEASE_OR_SNAPSHOT );

        return buildingRequest.getRepositorySession().getLocalRepositoryManager().getPathForLocalMetadata(
                aetherMetadata );
    }

    @Override
    public ProjectBuildingRequest setLocalRepositoryBasedir( ProjectBuildingRequest buildingRequest,
                                                             File basedir )
    {
        ProjectBuildingRequest newRequest = new DefaultProjectBuildingRequest( buildingRequest );

        RepositorySystemSession session = buildingRequest.getRepositorySession();

        // "clone" session and replace localRepository
        DefaultRepositorySystemSession newSession = new DefaultRepositorySystemSession( session );

        // Clear cache, since we're using a new local repository
        newSession.setCache( new DefaultRepositoryCache() );

        // keep same repositoryType
        String repositoryType = resolveRepositoryType( session.getLocalRepository() );
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



