Search in sources :

Example 1 with EnhancedLocalRepositoryManager

use of org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager in project maven-plugins by apache.

the class InstallMojoTest method createMavenSession.

private MavenSession createMavenSession() {
    MavenSession session = mock(MavenSession.class);
    DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
    repositorySession.setLocalRepositoryManager(new EnhancedLocalRepositoryManager(new File(LOCAL_REPO)));
    ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
    buildingRequest.setRepositorySession(repositorySession);
    when(session.getProjectBuildingRequest()).thenReturn(buildingRequest);
    return session;
}
Also used : MavenSession(org.apache.maven.execution.MavenSession) ProjectBuildingRequest(org.apache.maven.project.ProjectBuildingRequest) DefaultProjectBuildingRequest(org.apache.maven.project.DefaultProjectBuildingRequest) EnhancedLocalRepositoryManager(org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager) DefaultRepositorySystemSession(org.sonatype.aether.util.DefaultRepositorySystemSession) File(java.io.File) DefaultProjectBuildingRequest(org.apache.maven.project.DefaultProjectBuildingRequest)

Example 2 with EnhancedLocalRepositoryManager

use of org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager in project maven-plugins by apache.

the class InstallFileMojoTest method createMavenSession.

private MavenSession createMavenSession() {
    MavenSession session = mock(MavenSession.class);
    DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
    repositorySession.setLocalRepositoryManager(new EnhancedLocalRepositoryManager(new File(LOCAL_REPO)));
    ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
    buildingRequest.setRepositorySession(repositorySession);
    when(session.getProjectBuildingRequest()).thenReturn(buildingRequest);
    return session;
}
Also used : MavenSession(org.apache.maven.execution.MavenSession) ProjectBuildingRequest(org.apache.maven.project.ProjectBuildingRequest) DefaultProjectBuildingRequest(org.apache.maven.project.DefaultProjectBuildingRequest) EnhancedLocalRepositoryManager(org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager) DefaultRepositorySystemSession(org.sonatype.aether.util.DefaultRepositorySystemSession) File(java.io.File) DefaultProjectBuildingRequest(org.apache.maven.project.DefaultProjectBuildingRequest)

Aggregations

File (java.io.File)2 MavenSession (org.apache.maven.execution.MavenSession)2 DefaultProjectBuildingRequest (org.apache.maven.project.DefaultProjectBuildingRequest)2 ProjectBuildingRequest (org.apache.maven.project.ProjectBuildingRequest)2 EnhancedLocalRepositoryManager (org.sonatype.aether.impl.internal.EnhancedLocalRepositoryManager)2 DefaultRepositorySystemSession (org.sonatype.aether.util.DefaultRepositorySystemSession)2