Package org.apache.maven.artifact.repository

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


        if (repositoryUrl != null) {
            ArtifactRepositoryPolicy policy =
                new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
                                              ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );
            ArtifactRepository remoteRepo = artifactRepositoryFactory.createArtifactRepository(repositoryId, repositoryUrl,
                    repositoryLayout, policy, policy);

            repoList.add(remoteRepo);
        }
View Full Code Here


        String mavenRepoLocal = "file://" + localRepoPath;

        ArtifactRepositoryLayout layout =
                (ArtifactRepositoryLayout) container.lookup(ArtifactRepositoryLayout.ROLE, "default");
       
        ArtifactRepository localRepository = new DefaultArtifactRepository("local", mavenRepoLocal, layout);

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

        String archetypeGroupId = "org.appfuse.archetypes";
View Full Code Here

        if (index3 > 0) {
            resourceLocation = resourceLocation.substring(0, index3);
        }

        //check if the resourceLocation descriptor contains also remote repository information.
        ArtifactRepository repo = null;
        if (resourceLocation.startsWith("http://")) {
            final int repoDelimIntex = resourceLocation.indexOf('!');
            String repoUrl = resourceLocation.substring(0, repoDelimIntex);

            repo = new DefaultArtifactRepository(
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

      File parentFile = parent.getFile();

      if (parentFile == null) {
        // Parent artifact contains no actual file, so we resolve against
        // the local repository
        ArtifactRepository localRepository = getLocalRepository(build.getMavenBuildInformation(), parent, pom);
        if (localRepository != null) {
            Artifact parentArtifact = getArtifact(parent);
          // Don't use ArtifactRepository.find(), for compatibility with Maven 2.x
            if (parentArtifact != null) {
                parentFile = new File(localRepository.getBasedir(),
              localRepository.pathOf(parentArtifact));
            }
        }
      }
     
      if (parentFile != null) {
View Full Code Here

            MavenEmbedder embedder = createEmbedder(listener, build);
            ArtifactRepositoryLayout layout =
                    (ArtifactRepositoryLayout) embedder.lookup(ArtifactRepositoryLayout.ROLE, "default");
            ArtifactRepositoryFactory factory =
                    (ArtifactRepositoryFactory) embedder.lookup(ArtifactRepositoryFactory.ROLE);
            ArtifactRepository artifactRepository = null;
            if (url != null) {
                // By default we try to get the repository definition from the job configuration
                artifactRepository = getDeploymentRepository(factory, layout, id, url);
            }
            for (MavenAbstractArtifactRecord mavenAbstractArtifactRecord : mavenAbstractArtifactRecords) {
View Full Code Here

        return true;
    }

    private ArtifactRepository getDeploymentRepository(ArtifactRepositoryFactory factory, ArtifactRepositoryLayout layout, String repositoryId, String repositoryUrl) throws ComponentLookupException {
        if (repositoryUrl == null) return null;
        final ArtifactRepository repository = factory.createDeploymentArtifactRepository(
                repositoryId, repositoryUrl, layout, uniqueVersion);
        return new WrappedArtifactRepository(repository, uniqueVersion);
    }
View Full Code Here

                    ArtifactRepositoryLayout layout =
                        embedder.lookup( ArtifactRepositoryLayout.class,"default");
                    ArtifactRepositoryFactory factory =
                        (ArtifactRepositoryFactory) embedder.lookup(ArtifactRepositoryFactory.ROLE);

                    ArtifactRepository repository = factory.createDeploymentArtifactRepository(
                            id, repositoryUrl, layout, uniqueVersion);
                    WrappedArtifactRepository repo = new WrappedArtifactRepository(repository, uniqueVersion);
                    deploy(embedder,repo,listener);

                    record.result = Result.SUCCESS;
View Full Code Here

                                                        Properties userProperties, boolean showErrors )
        throws ComponentLookupException
    {
        MavenExecutionRequest request;

        ArtifactRepository localRepository = createLocalRepository( embedder, settings, commandLine );

        File userDir = new File( System.getProperty( "user.dir" ) );

        request = new DefaultMavenExecutionRequest( localRepository, settings, eventDispatcher,
                                                    commandLine.getArgList(), userDir.getPath(), profileManager,
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

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.