Package org.apache.maven.artifact.repository

Examples of org.apache.maven.artifact.repository.ArtifactRepository


    }

    private boolean validateMetadata( Artifact artifact )
        throws ArtifactConversionException
    {
        ArtifactRepository repository = artifact.getRepository();

        boolean result = true;

        RepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact );
        File file =
            new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) );
        if ( file.exists() )
        {
            Metadata metadata = readMetadata( file );
            result = validateMetadata( metadata, repositoryMetadata, artifact );
        }

        repositoryMetadata = new SnapshotArtifactRepositoryMetadata( artifact );
        file = new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) );
        if ( file.exists() )
        {
            Metadata metadata = readMetadata( file );
            result = result && validateMetadata( metadata, repositoryMetadata, artifact );
        }
View Full Code Here


        File pomFile = request.getProject().getFile();

        @SuppressWarnings( "unchecked" )
        List<Artifact> attachedArtifacts = request.getProject().getAttachedArtifacts();

        ArtifactRepository repo =
            getDeploymentRepository( request.getProject(), request.getAltDeploymentRepository(),
                                     request.getAltReleaseDeploymentRepository(),
                                     request.getAltSnapshotDeploymentRepository() );

        String protocol = repo.getProtocol();

        if ( protocol.equalsIgnoreCase( "scp" ) )
        {
            File sshFile = new File( System.getProperty( "user.home" ), ".ssh" );
View Full Code Here

    }

    ArtifactRepository getDeploymentRepository( MavenProject project, String altDeploymentRepository, String altReleaseDeploymentRepository, String altSnapshotDeploymentRepository )
        throws MojoExecutionException, MojoFailureException
    {
        ArtifactRepository repo = null;

        String altDeploymentRepo;
        if ( ArtifactUtils.isSnapshot( project.getVersion() ) && altSnapshotDeploymentRepository != null )
        {
            altDeploymentRepo = altSnapshotDeploymentRepository;
View Full Code Here

        mojo.useRepositoryLayout = true;
        mojo.execute();
       
        File outputDirectory = mojo.outputDirectory;
    ArtifactRepository targetRepository = mojo.repositoryFactory.createDeploymentArtifactRepository(
            "local",
            outputDirectory.toURL().toExternalForm(),
                new DefaultRepositoryLayout(),
                false );
View Full Code Here

        validateArtifactInformation();

        ArtifactRepositoryLayout layout = getLayout( repositoryLayout );

        ArtifactRepository deploymentRepository =
            repositoryFactory.createDeploymentArtifactRepository( repositoryId, url, layout, uniqueVersion );

        String protocol = deploymentRepository.getProtocol();

        if ( StringUtils.isEmpty( protocol ) )
        {
            throw new MojoExecutionException( "No transfer protocol found." );
        }
View Full Code Here

        BuildClasspathMojo mojo = (BuildClasspathMojo) lookupMojo( "build-classpath", testPom );

        assertNotNull( mojo );
        assertNotNull( mojo.getProject() );

        ArtifactRepository local = new StubArtifactRepository( stubFactory.getWorkingDir().getPath() );
        mojo.setLocal( local );

        Artifact artifact = stubFactory.getReleaseArtifact();

View Full Code Here

        {
            getLog().info( "Skipping artifact installation per configuration." );
            return;
        }

        ArtifactRepository testRepository = createTestRepository();

        installedArtifacts = new HashSet();
        copiedArtifacts = new HashSet();

        installProjectDependencies( project, reactorProjects, testRepository );
View Full Code Here

     * @throws MojoExecutionException If the repository could not be created.
     */
    private ArtifactRepository createTestRepository()
        throws MojoExecutionException
    {
        ArtifactRepository testRepository = localRepository;

        if ( localRepositoryPath != null )
        {
            try
            {
View Full Code Here

        // NOTE: Since these are '-sources' and '-test-sources' artifacts, they won't actually
        // resolve transitively...this is just used to aggregate resolution failures into a single
        // exception.
        final Set<Artifact> artifactSet = new LinkedHashSet<Artifact>( artifacts );
        final Artifact pomArtifact = config.project().getArtifact();
        final ArtifactRepository localRepo = config.localRepository();
        final List<ArtifactRepository> remoteRepos = config.project().getRemoteArtifactRepositories();
        final ArtifactMetadataSource metadataSource = config.artifactMetadataSource();

        final ArtifactFilter filter = config.filter();
        ArtifactFilter resolutionFilter = null;
View Full Code Here

        }

        if ( repositoryUrl != null )
        {
            getLog().warn( "repositoryUrl parameter is deprecated. Use remoteRepositories instead" );
            ArtifactRepository remoteRepo =
                artifactRepositoryFactory.createArtifactRepository( repositoryId, repositoryUrl, getLayout( "default" ),
                                                                    always, always );
            repoList.add( remoteRepo );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.ArtifactRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.