Package org.apache.maven.artifact.repository

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


        projectBuilder = (MavenProjectBuilder) lookup( MavenProjectBuilder.ROLE );

        ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
        String localRepoPath = getTestFile( "target/local-repository" ).getAbsolutePath().replace( '\\', '/' );
        localRepository = new DefaultArtifactRepository( "local", "file://" + localRepoPath, layout );
    }
View Full Code Here


        File testFile = getTestFile( "target/test-classes/projects/" + path + subpath + "/pom.xml" );
        Stack<File> projectFiles = new Stack<File>();
        projectFiles.push( testFile );

        List<DefaultArtifactRepository> repos =
            Collections.singletonList( new DefaultArtifactRepository( "central", getRemoteRepositoryURL(), new DefaultRepositoryLayout() ) );

        Repository repository = new Repository();
        repository.setId( "central" );
        repository.setUrl( getRemoteRepositoryURL() );
View Full Code Here

        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
        remoteRepositories.add( repoFactory.createArtifactRepository( "central", remoteRepoDir.toURI().toURL()
            .toExternalForm(), new DefaultRepositoryLayout(), null, null ) );
        mojo.setRemoteRepos( remoteRepositories );

        DefaultArtifactRepository localRepository = new DefaultArtifactRepository( "local",
            localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
        localRepository.setBasedir( localRepo.getAbsolutePath() );
        mojo.setLocal( localRepository );

        mojo.execute();

        assertTrue( "Directory org.eclipse.core.jobs_3.3.1.R33x_v20070709 not exists", checkExists( getBasedir()
View Full Code Here

        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
        remoteRepositories.add( repoFactory.createArtifactRepository( "central", remoteRepoDir.toURI().toURL()
            .toExternalForm(), new DefaultRepositoryLayout(), null, null ) );
        mojo.setRemoteRepos( remoteRepositories );

        DefaultArtifactRepository localRepository = new DefaultArtifactRepository( "local",
            localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
        localRepository.setBasedir( localRepo.getAbsolutePath() );
        mojo.setLocal( localRepository );

        mojo.execute();

        assertTrue( "File org.eclipse.core.jobs_3.3.1.R33x_v20070709.jar not exists", checkExists( getBasedir()
View Full Code Here

        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
        remoteRepositories.add( repoFactory.createArtifactRepository( "central", remoteRepoDir.toURI().toURL()
            .toExternalForm(), new DefaultRepositoryLayout(), null, null ) );
        mojo.setRemoteRepos( remoteRepositories );

        DefaultArtifactRepository localRepository = new DefaultArtifactRepository( "local",
            localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
        localRepository.setBasedir( localRepo.getAbsolutePath() );
        mojo.setLocal( localRepository );

        mojo.execute();

        assertTrue( "File org.eclipse.core.jobs_3.3.1.R33x_v20070709.jar not exists", checkExists( getBasedir()
View Full Code Here

        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();
        remoteRepositories.add( repoFactory.createArtifactRepository( "central", remoteRepoDir.toURI().toURL()
            .toExternalForm(), new DefaultRepositoryLayout(), null, null ) );
        mojo.setRemoteRepos( remoteRepositories );

        DefaultArtifactRepository localRepository = new DefaultArtifactRepository( "local",
            localRepo.getAbsolutePath(), new DefaultRepositoryLayout() );
        localRepository.setBasedir( localRepo.getAbsolutePath() );
        mojo.setLocal( localRepository );

        mojo.execute();

        assertTrue( "Directory org.eclipse.core.jobs_3.3.1.R33x_v20070709 not exists", checkExists( getBasedir()
View Full Code Here

        if ( !url.startsWith( "file:" ) )
        {
            url = "file://" + url;
        }

        ArtifactRepository localRepository = new DefaultArtifactRepository( "local", url, repositoryLayout );

        boolean snapshotPolicySet = false;

        if ( commandLine.hasOption( CLIManager.OFFLINE ) )
        {
View Full Code Here

        ArtifactRepository repo = null;
        if (resourceLocation.startsWith("http://")) {
            final int repoDelimIntex = resourceLocation.indexOf('!');
            String repoUrl = resourceLocation.substring(0, repoDelimIntex);

            repo = new DefaultArtifactRepository(
                    repoUrl,
                    repoUrl,
                    new DefaultRepositoryLayout());
            org.apache.maven.repository.Proxy mavenProxy = configureProxyToInlineRepo();
            if (mavenProxy != null) {
View Full Code Here

        if (bundle.indexOf(MVN_REPO_SEPARATOR) >= 0) {
            if (bundle.startsWith(MVN_URI_PREFIX)) {
                bundle = bundle.substring(MVN_URI_PREFIX.length());
            }
            String repo = bundle.substring(0, bundle.indexOf(MVN_REPO_SEPARATOR));
            ArtifactRepository repository = new DefaultArtifactRepository(artifact.getArtifactId() + "-repo", repo,
                    new DefaultRepositoryLayout());
            List<ArtifactRepository> repos = new LinkedList<ArtifactRepository>();
            repos.add(repository);
            resolver.resolve(artifact, repos, localRepo);
        } else {
View Full Code Here

        ArtifactRepositoryLayout layout =
            (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, "legacy" );

        String mavenRepoLocal = getTestFile( "target/local-repository" ).toURL().toString();

        ArtifactRepository localRepository = new DefaultArtifactRepository( "local", mavenRepoLocal, layout );

        List<ArtifactRepository> remoteRepositories = new ArrayList<ArtifactRepository>();

        String mavenRepoRemote = getTestFile( "src/test/repository" ).toURL().toString();

        ArtifactRepository remoteRepository = new DefaultArtifactRepository( "remote", mavenRepoRemote, layout );

        remoteRepositories.add( remoteRepository );

        ArchetypeGenerationRequest request = new ArchetypeGenerationRequest()
            .setPackage( "org.apache.maven.quickstart" )
View Full Code Here

TOP

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

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.