Examples of MavenArtifactRepository


Examples of fr.imag.adele.apam.declarations.repository.maven.MavenArtifactRepository

   
    if (manager == null) {
      reporter.report(Severity.ERROR, "Cannot generate ACR content, invalid repository manager");
    }

    MavenArtifactRepository buildRepository = project.getBuildRepository();
   
    StringBuilder result = new StringBuilder("<obr>\n");

    /*
     *  Add capability to represent maven inforamtion
     */
    Capability mavenCapability = CapabilityEncoder.builder(CST.MAVEN).
                    property(CST.GROUP_ID, buildRepository.getArtifact().getGroupId()).
                    property(CST.ARTIFACT_ID, buildRepository.getArtifact().getArtifactId()).
                    property(CST.VERSION, buildRepository.getArtifact().getVersion()).
                      build();

    result.append(manager.getHelper().writeCapability(mavenCapability)).append("\n");

 
    /*
     *  Add capabilities to represent component metadata
     */
    CapabilityEncoder encoder         = new CapabilityEncoder();
    Set<ComponentReference<?>> processed  = new HashSet<ComponentReference<?>>();
    Set<VersionedReference<?>> referenced      = new HashSet<VersionedReference<?>>();

    for (ComponentDeclaration component : buildRepository.getComponents()) {
     
      if (processed.contains(component.getReference())) {
        reporter.report(Severity.WARNING,"Component " + component.getName() + " already defined in this build, declaration ignored "+component);
        continue;
      }
View Full Code Here

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

    private ModelReader modelReader;

    public ArtifactRepository buildArtifactRepository( Repository repository )
        throws InvalidRepositoryException
    {
        return new MavenArtifactRepository( repository.getId(), repository.getUrl(), new DefaultRepositoryLayout(),
                                            new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy() );
    }
View Full Code Here

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

    public ArtifactRepository createArtifactRepository( String id, String url,
                                                        ArtifactRepositoryLayout repositoryLayout,
                                                        ArtifactRepositoryPolicy snapshots,
                                                        ArtifactRepositoryPolicy releases )
    {
        return new MavenArtifactRepository( id, url, repositoryLayout, snapshots, releases );
    }
View Full Code Here

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

    }

    public ArtifactRepository createDefaultRemoteRepository()
        throws InvalidRepositoryException
    {
        return new MavenArtifactRepository( DEFAULT_REMOTE_REPO_ID, "file://"
            + new File( System.getProperty( "basedir", "" ), "src/test/remote-repo" ).toURI().getPath(),
                                            new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
                                            new ArtifactRepositoryPolicy() );
    }
View Full Code Here

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

    }

    public ArtifactRepository createLocalRepository( File localRepository )
        throws InvalidRepositoryException
    {
        return new MavenArtifactRepository( DEFAULT_LOCAL_REPO_ID, "file://" + localRepository.toURI().getPath(),
                                            new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
                                            new ArtifactRepositoryPolicy() );
    }
View Full Code Here

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

      return result;
   }

   public static ArtifactRepository convertFromMavenSettingsRepository(Repository repository)
   {
      MavenArtifactRepository result = new MavenArtifactRepository();
      result.setId(repository.getId());
      result.setUrl(repository.getUrl());

      String layout = repository.getLayout();
      if ("default".equals(layout))
         result.setLayout(new DefaultRepositoryLayout());
      else if ("p2".equals(layout))
         result.setLayout(new P2ArtifactRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

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

   public static ArtifactRepository toArtifactRepository(String id, String url, String layout,
            boolean containsReleases,
            boolean containsSnapshots)
   {
      MavenArtifactRepository result = new MavenArtifactRepository();
      result.setId(id);
      result.setUrl(url);

      if (layout == null || layout.isEmpty() || "default".equals(layout))
      {
         result.setLayout(new DefaultRepositoryLayout());
      }
      else if ("p2".equals(layout))
      {
         result.setLayout(new P2ArtifactRepositoryLayout());
      }
      result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(containsReleases,
               ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
               ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
      result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(containsSnapshots,
               ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
               ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
      return result;

   }
View Full Code Here

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

   @Override
   public ArtifactRepository newMavenArtifactRepository(String id, String url, ArtifactRepositoryPolicy snapshots,
            ArtifactRepositoryPolicy releases)
   {
      return new MavenArtifactRepository(id, url, this, DISABLED_POLICY, DISABLED_POLICY);
   }
View Full Code Here

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

      return result;
   }

   public static ArtifactRepository convertFromMavenSettingsRepository(Repository repository)
   {
      MavenArtifactRepository result = new MavenArtifactRepository();
      result.setId(repository.getId());
      result.setUrl(repository.getUrl());

      String layout = repository.getLayout();
      if ("default".equals(layout))
         result.setLayout(new DefaultRepositoryLayout());
      else if ("flat".equals(layout))
         result.setLayout(new FlatRepositoryLayout());

      RepositoryPolicy releases = repository.getReleases();
      if (releases != null)
         result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(releases.isEnabled(), releases.getUpdatePolicy(),
                  releases.getChecksumPolicy()));

      RepositoryPolicy snapshots = repository.getSnapshots();
      if (snapshots != null)
         result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(snapshots.isEnabled(),
                  snapshots.getUpdatePolicy(),
                  snapshots.getChecksumPolicy()));

      return result;
   }
View Full Code Here

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

   public static ArtifactRepository toArtifactRepository(String id, String url, String layout,
            boolean containsReleases,
            boolean containsSnapshots)
   {
      MavenArtifactRepository result = new MavenArtifactRepository();
      result.setId(id);
      result.setUrl(url);

      if (layout == null || layout.isEmpty() || "default".equals(layout))
      {
         result.setLayout(new DefaultRepositoryLayout());
      }
      else if ("flat".equals(layout))
      {
         result.setLayout(new FlatRepositoryLayout());
      }
      result.setReleaseUpdatePolicy(new ArtifactRepositoryPolicy(containsReleases,
               ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
               ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
      result.setSnapshotUpdatePolicy(new ArtifactRepositoryPolicy(containsSnapshots,
               ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
               ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN));
      return result;

   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.