本文整理汇总了Java中org.apache.maven.settings.Repository.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.setName方法的具体用法?Java Repository.setName怎么用?Java Repository.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.settings.Repository
的用法示例。
在下文中一共展示了Repository.setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addReleaseRepositories
import org.apache.maven.settings.Repository; //导入方法依赖的package包/类
/**
* Adds a list of release repository configurations to the maven profile object
*
* @param contextUrl System URL
* @param profile Maven profile to append to
* @param repositories Repositories to add to the profile
*/
private void addReleaseRepositories(String contextUrl, Profile profile,
List<MavenSettingsRepository> repositories) {
for (MavenSettingsRepository repository : repositories) {
Repository repoToAdd = new Repository();
repoToAdd.setId(repository.getId());
String repositoryName = repository.getName();
repoToAdd.setName(repositoryName);
repoToAdd.setUrl(contextUrl + repositoryName);
boolean handlesSnapshots = repository.isHandlesSnapshots();
RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
snapshotPolicy.setEnabled(handlesSnapshots);
repoToAdd.setSnapshots(snapshotPolicy);
profile.addRepository(repoToAdd);
}
}
示例2: addPluginRepositories
import org.apache.maven.settings.Repository; //导入方法依赖的package包/类
/**
* Adds a list of plugin repository configurations to the maven profile object
*
* @param contextUrl System URL
* @param profile Maven profile to append to
* @param repositories Repositories to add to the profile
*/
private void addPluginRepositories(String contextUrl, Profile profile, List<MavenSettingsRepository> repositories) {
for (MavenSettingsRepository repository : repositories) {
Repository repoToAdd = new Repository();
repoToAdd.setId(repository.getId());
String repositoryName = repository.getName();
repoToAdd.setName(repositoryName);
repoToAdd.setUrl(contextUrl + repositoryName);
boolean handlesSnapshots = repository.isHandlesSnapshots();
RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
snapshotPolicy.setEnabled(handlesSnapshots);
repoToAdd.setSnapshots(snapshotPolicy);
profile.addPluginRepository(repoToAdd);
}
}