本文整理了Java中org.apache.maven.model.Profile.addRepository()
方法的一些代码示例,展示了Profile.addRepository()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Profile.addRepository()
方法的具体详情如下:
包路径:org.apache.maven.model.Profile
类名称:Profile
方法名:addRepository
暂无
代码示例来源:origin: apache/maven
profile.addRepository( convertFromProfileXmlRepository( (org.apache.maven.profiles.Repository) repo ) );
代码示例来源:origin: apache/maven
profile.addRepository( convertFromSettingsRepository( repo ) );
代码示例来源:origin: org.apache.maven/maven-ant-tasks
/**
* The repositories defined in the ant "pom" task need to be added manually to the profile manager. Otherwise they
* won't be available when resolving the parent pom. MANTTASKS-87
*/
private void addAntRepositoriesToProfileManager()
{
List<RemoteRepository> remoteRepositories = this.getRemoteRepositories();
if ( remoteRepositories == null || remoteRepositories.isEmpty() )
{
return;
}
org.apache.maven.model.Profile repositoriesProfile = new org.apache.maven.model.Profile();
repositoriesProfile.setId( "maven-ant-tasks-repo-profile" );
for ( RemoteRepository antRepo : remoteRepositories )
{
Repository mavenRepo = new Repository();
mavenRepo.setId( antRepo.getId() );
mavenRepo.setUrl( antRepo.getUrl() );
repositoriesProfile.addRepository( mavenRepo );
}
getProfileManager().addProfile( repositoriesProfile );
getProfileManager().explicitlyActivate( repositoriesProfile.getId() );
}
内容来源于网络,如有侵权,请联系作者删除!