Package org.apache.maven.model

Examples of org.apache.maven.model.Repository


    {
        List repositories = new ArrayList();

        for ( Iterator it = dominant.iterator(); it.hasNext(); )
        {
            Repository repository = (Repository) it.next();

            repositories.add( repository );
        }

        for ( Iterator it = recessive.iterator(); it.hasNext(); )
        {
            Repository repository = (Repository) it.next();

            if ( !repositories.contains( repository ) )
            {
                repositories.add( repository );
            }
View Full Code Here


        {
            Profile externalProfile = (Profile) i.next();

            for ( Iterator repoIterator = externalProfile.getRepositories().iterator(); repoIterator.hasNext(); )
            {
                Repository mavenRepo = (Repository) repoIterator.next();

                ArtifactRepository artifactRepo = null;
                try
                {
                    artifactRepo = ProjectUtils.buildArtifactRepository( mavenRepo, artifactRepositoryFactory, container );
View Full Code Here

        List repos = new ArrayList();

        for ( Iterator i = repositories.iterator(); i.hasNext(); )
        {
            Repository mavenRepo = (Repository) i.next();

            ArtifactRepository artifactRepo =
                buildArtifactRepository( mavenRepo, artifactRepositoryFactory, container );

            if ( !repos.contains( artifactRepo ) )
View Full Code Here

    private static Model makeRepositoryModel( String artifactId, String id, String url )
    {
        Model model = makeBaseModel( artifactId );

        Repository repository = makeRepository( id, url );

        model.setRepositories( new ArrayList( Collections.singletonList( repository ) ) );

        return model;
    }
View Full Code Here

        return model;
    }

    private static Repository makeRepository( String id, String url )
    {
        Repository repository = new Repository();
        repository.setId( id );
        repository.setUrl( url );
        return repository;
    }
View Full Code Here

    {
        assertEquals( "Repository list sizes don't match", expected.size(), actual.size() );

        for ( Iterator i = expected.iterator(); i.hasNext(); )
        {
            Repository expectedRepository = (Repository) i.next();
            boolean found = false;
            for ( Iterator j = actual.iterator(); j.hasNext() && !found; )
            {
                Repository actualRepository = (Repository) j.next();

                if ( actualRepository.getId().equals( expectedRepository.getId() ) )
                {
                    assertEquals( "Repository URLs don't match", expectedRepository.getUrl(),
                                  actualRepository.getUrl() );
                    found = true;
                }
            }
            assertTrue( "Repository with ID " + expectedRepository.getId() + " not found", found );
        }
View Full Code Here

      return false;
   }
  
   private void addPluginRepository(MetaModelProvider provider)
   {
      Repository repository = provider.getAptPluginRepository();
      if (repository != null)
      {
         MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
         pluginFacet.addPluginRepository(repository.getName(), repository.getUrl());
      }
   }
View Full Code Here

        String repoId = "test-repo";

        Profile profile = new Profile();
        profile.setId( profileId );

        Repository repo = new Repository();
        repo.setId( repoId );
        repo.setUrl( "http://www.google.com" );

        profile.addRepository( repo );

        pm.addProfile( profile );
        pm.explicitlyActivate( profileId );

        MavenProject project = projectBuilder.buildStandaloneSuperProject( getLocalRepository(), pm );

        List repositories = project.getRepositories();

        assertNotNull( repositories );

        Repository result = null;

        for ( Iterator it = repositories.iterator(); it.hasNext(); )
        {
            Repository candidate = (Repository) it.next();

            if ( repoId.equals( candidate.getId() ) )
            {
                result = candidate;
                break;
            }
        }
View Full Code Here

    {
        Model model = new Model();
        model.setVersion( "3.8.1" );
        model.setArtifactId( "foo" );

        Repository repository = new Repository();

        repository.setUrl( "file://localhost/${basedir}/temp-repo" );

        model.addRepository( repository );

        Model out = new RegexBasedModelInterpolator().interpolate( model, context );
View Full Code Here

        {
            Profile externalProfile = (Profile) i.next();

            for ( Iterator repoIterator = externalProfile.getRepositories().iterator(); repoIterator.hasNext(); )
            {
                Repository mavenRepo = (Repository) repoIterator.next();

                ArtifactRepository artifactRepo = null;
                try
                {
                    artifactRepo =
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Repository

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.