本文整理了Java中org.apache.maven.model.Repository.setSnapshots
方法的一些代码示例,展示了Repository.setSnapshots
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.setSnapshots
方法的具体详情如下:
包路径:org.apache.maven.model.Repository
类名称:Repository
方法名:setSnapshots
[英]Set how to handle downloading of snapshots from this repository.
[中]设置如何处理从此存储库下载快照。
代码示例来源:origin: apache/maven
protected void mergeRepository_Snapshots( Repository target, Repository source, boolean sourceDominant,
Map<Object, Object> context )
{
RepositoryPolicy src = source.getSnapshots();
if ( src != null )
{
RepositoryPolicy tgt = target.getSnapshots();
if ( tgt == null )
{
tgt = new RepositoryPolicy();
target.setSnapshots( tgt );
}
mergeRepositoryPolicy( tgt, src, sourceDominant, context );
}
}
代码示例来源:origin: org.apache.maven/maven-project
public static Repository cloneRepository( Repository src )
{
if ( src == null )
{
return null;
}
Repository result = new Repository();
result.setReleases( cloneRepositoryPolicy( src.getReleases() ) );
result.setSnapshots( cloneRepositoryPolicy( src.getSnapshots() ) );
cloneRepositoryBaseFields( src, result );
return result;
}
代码示例来源:origin: apache/maven
public static org.apache.maven.model.Repository fromSettingsRepository( org.apache.maven.settings.Repository
settingsRepository )
{
org.apache.maven.model.Repository modelRepository = new org.apache.maven.model.Repository();
modelRepository.setId( settingsRepository.getId() );
modelRepository.setLayout( settingsRepository.getLayout() );
modelRepository.setName( settingsRepository.getName() );
modelRepository.setUrl( settingsRepository.getUrl() );
modelRepository.setReleases( fromSettingsRepositoryPolicy( settingsRepository.getReleases() ) );
modelRepository.setSnapshots( fromSettingsRepositoryPolicy( settingsRepository.getSnapshots() ) );
return modelRepository;
}
代码示例来源:origin: apache/maven
private static Repository convertFromProfileXmlRepository( org.apache.maven.profiles.Repository profileXmlRepo )
{
Repository repo = new Repository();
repo.setId( profileXmlRepo.getId() );
repo.setLayout( profileXmlRepo.getLayout() );
repo.setName( profileXmlRepo.getName() );
repo.setUrl( profileXmlRepo.getUrl() );
if ( profileXmlRepo.getSnapshots() != null )
{
repo.setSnapshots( convertRepositoryPolicy( profileXmlRepo.getSnapshots() ) );
}
if ( profileXmlRepo.getReleases() != null )
{
repo.setReleases( convertRepositoryPolicy( profileXmlRepo.getReleases() ) );
}
return repo;
}
代码示例来源:origin: apache/maven
/**
* @param settingsRepo
* @return a repository
*/
private static org.apache.maven.model.Repository convertFromSettingsRepository( Repository settingsRepo )
{
org.apache.maven.model.Repository repo = new org.apache.maven.model.Repository();
repo.setId( settingsRepo.getId() );
repo.setLayout( settingsRepo.getLayout() );
repo.setName( settingsRepo.getName() );
repo.setUrl( settingsRepo.getUrl() );
if ( settingsRepo.getSnapshots() != null )
{
repo.setSnapshots( convertRepositoryPolicy( settingsRepo.getSnapshots() ) );
}
if ( settingsRepo.getReleases() != null )
{
repo.setReleases( convertRepositoryPolicy( settingsRepo.getReleases() ) );
}
return repo;
}
代码示例来源:origin: apache/maven
repository.setSnapshots( parseRepositoryPolicy( parser, strict ) );
代码示例来源:origin: apache/maven
repository.setSnapshots( parseRepositoryPolicy( parser, strict, source ) );
代码示例来源:origin: takari/polyglot-maven
public default Repository repository(String id, String name, String url, String layout, RepositoryPolicy releases, RepositoryPolicy snapshots) {
Repository repository = new Repository();
if (id != null) {
repository.setId(id);
}
if (name != null) {
repository.setName(name);
}
if (url != null) {
repository.setUrl(url);
}
if (layout != null) {
repository.setLayout(layout);
}
if (releases != null) {
repository.setReleases(releases);
}
if (snapshots != null) {
repository.setSnapshots(snapshots);
}
return repository;
}
代码示例来源:origin: takari/polyglot-maven
repository.setSnapshots( parseRepositoryPolicy( parser, strict ) );
代码示例来源:origin: io.tesla.maven/maven-model
protected void mergeRepository_Snapshots( Repository target, Repository source, boolean sourceDominant,
Map<Object, Object> context )
{
RepositoryPolicy src = source.getSnapshots();
if ( src != null )
{
RepositoryPolicy tgt = target.getSnapshots();
if ( tgt == null )
{
tgt = new RepositoryPolicy();
target.setSnapshots( tgt );
}
mergeRepositoryPolicy( tgt, src, sourceDominant, context );
}
}
代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven
private static Repository asRepository(org.apache.maven.settings.Repository repository) {
Repository mavenRepository = new Repository();
if (repository != null) {
mavenRepository.setId(repository.getId());
mavenRepository.setLayout(repository.getLayout());
mavenRepository.setName(repository.getName());
mavenRepository.setUrl(repository.getUrl());
mavenRepository.setReleases(asMavenRepositoryPolicy(repository.getReleases()));
mavenRepository.setSnapshots(asMavenRepositoryPolicy(repository.getSnapshots()));
}
return mavenRepository;
}
代码示例来源:origin: org.onehippo.cms7.essentials.sdk/implementation
@Override
public org.apache.maven.model.Repository createMavenRepository() {
org.apache.maven.model.Repository repository = new org.apache.maven.model.Repository();
repository.setName(getName());
repository.setId(getId());
repository.setUrl(getUrl());
final RepositoryPolicy policy = new RepositoryPolicy();
if (snapshots == null || snapshots.getEnabled() == null) {
policy.setEnabled(false);
} else {
policy.setEnabled(snapshots.getEnabled());
}
repository.setSnapshots(policy);
return repository;
}
代码示例来源:origin: org.onehippo.cms7.essentials/hippo-essentials-plugin-api-implementation
@Override
public org.apache.maven.model.Repository createMavenRepository() {
org.apache.maven.model.Repository repository = new org.apache.maven.model.Repository();
repository.setName(getName());
repository.setId(getId());
repository.setUrl(getUrl());
final RepositoryPolicy policy = new RepositoryPolicy();
if (snapshots == null || snapshots.getEnabled() == null) {
policy.setEnabled(false);
} else {
policy.setEnabled(snapshots.getEnabled());
}
repository.setSnapshots(policy);
return repository;
}
代码示例来源:origin: shrinkwrap/resolver
private static Repository asRepository(org.apache.maven.settings.Repository repository) {
Repository mavenRepository = new Repository();
if (repository != null) {
mavenRepository.setId(repository.getId());
mavenRepository.setLayout(repository.getLayout());
mavenRepository.setName(repository.getName());
mavenRepository.setUrl(repository.getUrl());
mavenRepository.setReleases(asMavenRepositoryPolicy(repository.getReleases()));
mavenRepository.setSnapshots(asMavenRepositoryPolicy(repository.getSnapshots()));
}
return mavenRepository;
}
代码示例来源:origin: org.commonjava.maven.cartographer/cartographer
repository.setSnapshots( snapshotsPolicy );
代码示例来源:origin: apache/maven-enforcer
private Repository createSnapshotRepository( String id, String url )
{
Repository r = new Repository();
r.setId( id );
r.setUrl( url );
RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
snapshotPolicy.setEnabled( true );
snapshotPolicy.setUpdatePolicy( "daily" );
r.setSnapshots( snapshotPolicy );
RepositoryPolicy releasePolicy = new RepositoryPolicy();
releasePolicy.setEnabled( false );
r.setReleases( releasePolicy );
return r;
}
代码示例来源:origin: apache/maven-enforcer
private Repository createRepository( String id, String url )
{
Repository r = new Repository();
r.setId( id );
r.setUrl( url );
RepositoryPolicy snapshotPolicy = new RepositoryPolicy();
snapshotPolicy.setEnabled( false );
snapshotPolicy.setUpdatePolicy( "daily" );
r.setSnapshots( snapshotPolicy );
RepositoryPolicy releasePolicy = new RepositoryPolicy();
releasePolicy.setEnabled( true );
releasePolicy.setUpdatePolicy( "never" );
r.setReleases( releasePolicy );
return r;
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
private Repository getRepository(JsonArray pluginRepositories, int i) {
Repository repo = new Repository();
repo.setId(pluginRepositories.getJsonObject(i).getString("id"));
repo.setName(pluginRepositories.getJsonObject(i).getString("name"));
repo.setUrl(pluginRepositories.getJsonObject(i).getString("url"));
RepositoryPolicy releases = new RepositoryPolicy();
releases.setEnabled(pluginRepositories.getJsonObject(i).getBoolean("releasesEnabled"));
releases.setUpdatePolicy(pluginRepositories.getJsonObject(i).getString("releasesUpdatePolicy"));
RepositoryPolicy snapshots = new RepositoryPolicy();
snapshots.setEnabled(pluginRepositories.getJsonObject(i).getBoolean("snapshotEnabled"));
snapshots.setUpdatePolicy(pluginRepositories.getJsonObject(i).getString("snapshotUpdatePolicy"));
repo.setSnapshots(snapshots);
return repo;
}
代码示例来源:origin: io.tesla.maven/maven-model
repository.setSnapshots( parseRepositoryPolicy( parser, strict ) );
代码示例来源:origin: io.tesla.maven/maven-model
repository.setSnapshots( parseRepositoryPolicy( parser, strict, source ) );
内容来源于网络,如有侵权,请联系作者删除!