org.apache.maven.settings.Profile.getRepositories()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.apache.maven.settings.Profile.getRepositories()方法的一些代码示例,展示了Profile.getRepositories()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.getRepositories()方法的具体详情如下:
包路径:org.apache.maven.settings.Profile
类名称:Profile
方法名:getRepositories

Profile.getRepositories介绍

[英]Method getRepositories.
[中]方法获取存储库。

代码示例

代码示例来源:origin: apache/maven

/**
 * Method addRepository.
 * 
 * @param repository
 */
public void addRepository( Repository repository )
{
  getRepositories().add( repository );
} //-- void addRepository( Repository )

代码示例来源:origin: apache/maven

/**
 * Method removeRepository.
 * 
 * @param repository
 */
public void removeRepository( Repository repository )
{
  getRepositories().remove( repository );
} //-- void removeRepository( Repository )

代码示例来源:origin: apache/maven

if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
  for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )

代码示例来源:origin: apache/maven

validateRepositories( problems, profile.getRepositories(), prefix + "repositories.repository" );
validateRepositories( problems, profile.getPluginRepositories(), prefix
  + "pluginRepositories.pluginRepository" );

代码示例来源:origin: org.apache.maven/maven-settings

/**
 * Method addRepository.
 * 
 * @param repository
 */
public void addRepository( Repository repository )
{
  getRepositories().add( repository );
} //-- void addRepository( Repository )

代码示例来源:origin: org.apache.maven/maven-settings

/**
 * Method removeRepository.
 * 
 * @param repository
 */
public void removeRepository( Repository repository )
{
  getRepositories().remove( repository );
} //-- void removeRepository( Repository )

代码示例来源:origin: apache/maven

List<Repository> remoteRepositories = rawProfile.getRepositories();
for ( Repository remoteRepository : remoteRepositories )

代码示例来源:origin: apache/maven

List<Repository> remoteRepositories = rawProfile.getRepositories();
for ( Repository remoteRepository : remoteRepositories )

代码示例来源:origin: apache/maven

List<Repository> repos = settingsProfile.getRepositories();
if ( repos != null )

代码示例来源:origin: org.apache.maven/maven-settings

if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
  for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )

代码示例来源:origin: io.fabric8/maven-util

public static List<Repository> getRepositories() {
  List<Repository> repositories = new LinkedList<Repository>();
  Settings settings = getSettings();
  Set<String> profileNames = new LinkedHashSet<String>();
  profileNames.addAll(settings.getActiveProfiles());
  for (Profile p : settings.getProfiles()) {
    if (p.getActivation() != null && p.getActivation().isActiveByDefault()) {
      profileNames.add(p.getId());
    }
  }
  for (String profileName : profileNames) {
    Object obj = settings.getProfilesAsMap().get(profileName);
    if (Profile.class.isAssignableFrom(obj.getClass())) {
      Profile p = (Profile) obj;
      for (Repository repository : p.getRepositories()) {
        repositories.add(repository);
      }
    }
  }
  return repositories;
}

代码示例来源:origin: org.springframework.boot/spring-boot-cli

private static void addActiveProfileRepositories(List<Profile> activeProfiles,
    List<RepositoryConfiguration> configurations) {
  for (Profile activeProfile : activeProfiles) {
    Interpolator interpolator = new RegexBasedInterpolator();
    interpolator.addValueSource(
        new PropertiesBasedValueSource(activeProfile.getProperties()));
    for (Repository repository : activeProfile.getRepositories()) {
      configurations.add(getRepositoryConfiguration(interpolator, repository));
    }
  }
}

代码示例来源:origin: org.jboss.forge/maven-impl

public List<RemoteRepository> getEnabledRepositoriesFromProfile(Settings settings)
{
 List<RemoteRepository> settingsRepos = new ArrayList<RemoteRepository>();
 List<String> activeProfiles = settings.getActiveProfiles();
 Map<String, Profile> profiles = settings.getProfilesAsMap();
 for (String id : activeProfiles)
 {
   Profile profile = profiles.get(id);
   if (profile != null)
   {
    List<Repository> repositories = profile.getRepositories();
    for (Repository repository : repositories)
    {
      settingsRepos.add(new RemoteRepository(repository.getId(), repository.getLayout(), repository.getUrl()));
    }
   }
 }
 return settingsRepos;
}

代码示例来源:origin: org.kie.soup/kie-soup-maven-integration

private Collection<RemoteRepository> initExtraRepositories() {
  Collection<RemoteRepository> extraRepositories = new HashSet<RemoteRepository>();
  for ( Profile profile : settings.getProfiles() ) {
    if ( isProfileActive( profile ) ) {
      for ( Repository repository : profile.getRepositories() ) {
        extraRepositories.add( toRemoteRepositoryBuilder( settings,
                                 repository ).build() );
      }
      for ( Repository repository : profile.getPluginRepositories() ) {
        extraRepositories.add( toRemoteRepositoryBuilder( settings,
                                 repository ).build() );
      }
    }
  }
  return extraRepositories;
}

代码示例来源:origin: spring-cloud/spring-cloud-function

private Collection<? extends ArtifactRepository> mavenRepositories(
    MavenSettings settings) {
  List<ArtifactRepository> list = new ArrayList<>();
  for (Profile profile : settings.getActiveProfiles()) {
    for (Repository repository : profile.getRepositories()) {
      addRepositoryIfMissing(list, repository.getId(), repository.getUrl(),
          repository.getReleases() != null
              ? repository.getReleases().isEnabled() : true,
          repository.getSnapshots() != null
              ? repository.getSnapshots().isEnabled() : false);
    }
  }
  return list;
}

代码示例来源:origin: org.jboss.forge.addon/maven-api

public ProfileAdapter(final org.apache.maven.settings.Profile profile)
{
 setId(profile.getId());
 Activation activation = new Activation();
 setActivation(activation);
 for (org.apache.maven.settings.Repository repository : profile.getRepositories())
 {
   Repository mavenRepository = new Repository();
   mavenRepository.setId(repository.getId());
   mavenRepository.setUrl(repository.getUrl());
   getRepositories().add(mavenRepository);
 }
 setProperties(profile.getProperties());
}

代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

public static Profile asProfile(org.apache.maven.settings.Profile profile) {
  Profile mavenProfile = new Profile();
  if (profile != null) {
    mavenProfile.setId(profile.getId());
    mavenProfile.setActivation(asActivation(profile.getActivation()));
    mavenProfile.setProperties(profile.getProperties());
    mavenProfile.setRepositories(asRepositories(profile.getRepositories()));
    mavenProfile.setPluginRepositories(asRepositories(profile.getPluginRepositories()));
  }
  return mavenProfile;
}

代码示例来源:origin: shrinkwrap/resolver

public static Profile asProfile(org.apache.maven.settings.Profile profile) {
  Profile mavenProfile = new Profile();
  if (profile != null) {
    mavenProfile.setId(profile.getId());
    mavenProfile.setActivation(asActivation(profile.getActivation()));
    mavenProfile.setProperties(profile.getProperties());
    mavenProfile.setRepositories(asRepositories(profile.getRepositories()));
    mavenProfile.setPluginRepositories(asRepositories(profile.getPluginRepositories()));
  }
  return mavenProfile;
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-maven-embedder

/**
 * Method updateProfile.
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
  Element root = element;
  Counter innerCount = new Counter(counter.getDepth() + 1);
  updateActivation( value.getActivation(), "activation", innerCount, root);
  findAndReplaceProperties(innerCount, root,  "properties", value.getProperties());
  iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
  iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
  findAndReplaceSimpleElement(innerCount, root,  "id", value.getId(), null);
} //-- void updateProfile(Profile, String, Counter, Element)

代码示例来源:origin: org.codehaus.mevenide/nb-mvn-embedder

/**
 * Method updateProfile
 * 
 * @param value
 * @param element
 * @param counter
 * @param xmlTag
 */
protected void updateProfile(Profile value, String xmlTag, Counter counter, Element element)
{
  Element root = element;
  Counter innerCount = new Counter(counter.getDepth() + 1);
  updateActivation( value.getActivation(), "activation", innerCount, root);
  findAndReplaceProperties(innerCount, root,  "properties", value.getProperties());
  iterateRepository(innerCount, root, value.getRepositories(),"repositories","repository");
  iterateRepository(innerCount, root, value.getPluginRepositories(),"pluginRepositories","pluginRepository");
  findAndReplaceSimpleElement(innerCount, root,  "id", value.getId(), null);
} //-- void updateProfile(Profile, String, Counter, Element)

相关文章