本文整理汇总了Java中org.netbeans.modules.maven.model.pom.RepositoryPolicy类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryPolicy类的具体用法?Java RepositoryPolicy怎么用?Java RepositoryPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryPolicy类属于org.netbeans.modules.maven.model.pom包,在下文中一共展示了RepositoryPolicy类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.netbeans.modules.maven.model.pom.RepositoryPolicy; //导入依赖的package包/类
@Override
@Messages({"ENABLED=Enabled", "UPDATE_POLICY=Update Policy", "CHECKSUM_POLICY=Checksum Policy"})
public void visit(RepositoryPolicy target) {
RepositoryPolicy t = target;
assert t != null ? t.isInDocumentModel() : true;
POMQNames names = parent.getPOMQNames();
checkChildString(names.ENABLED, ENABLED(), t != null ? (t.isEnabled() != null ? t.isEnabled().toString() : null) : null);
checkChildString(names.UPDATEPOLICY, UPDATE_POLICY(), t != null ? t.getUpdatePolicy() : null);
checkChildString(names.CHECKSUMPOLICY, CHECKSUM_POLICY(), t != null ? t.getChecksumPolicy() : null);
count++;
}
示例2: registerRepository
import org.netbeans.modules.maven.model.pom.RepositoryPolicy; //导入依赖的package包/类
private void registerRepository() {
if (sourceModel.getRepositories().size() > 0) {
operations.add(pomModel -> {
Set<String> existingRepositories = getPOMProject().getRepositories() != null ?
getPOMProject().getRepositories()
.stream()
.map(Repository::getId)
.collect(toSet())
: Collections.EMPTY_SET;
for (org.apache.maven.model.Repository repository : sourceModel.getRepositories()) {
if (!existingRepositories.contains(repository.getId())) {
Repository repo = pomModel.getFactory().createRepository();
repo.setId(repository.getId());//isSnapshot ? MavenNbModuleImpl.NETBEANS_SNAPSHOT_REPO_ID : MavenNbModuleImpl.NETBEANS_REPO_ID);
repo.setName(repository.getName());
repo.setLayout(repository.getLayout());
repo.setUrl(repository.getUrl());
if (repository.getSnapshots() != null) {
RepositoryPolicy policy = pomModel.getFactory().createReleaseRepositoryPolicy();
policy.setEnabled(Boolean.valueOf(repository.getSnapshots().getEnabled()));
repo.setReleases(policy);
}
getPOMProject().addRepository(repo);
}
}
});
}
}
示例3: fillRepository
import org.netbeans.modules.maven.model.pom.RepositoryPolicy; //导入依赖的package包/类
private void fillRepository(JsonNode depsMeta, String repoId, Repository repository) {
JsonNode repoInfo = depsMeta.path("repositories").path(repoId);
repository.setId(repoId);
repository.setName(repoInfo.path("name").asText());
repository.setUrl(repoInfo.path("url").asText());
// set repository policies (release, snapshots)
if (repoInfo.hasNonNull("snapshotEnabled")) {
RepositoryPolicy snapshots = model.getFactory().createSnapshotRepositoryPolicy();
snapshots.setEnabled(repoInfo.get("snapshotEnabled").asBoolean());
repository.setSnapshots(snapshots);
}
}
示例4: visit
import org.netbeans.modules.maven.model.pom.RepositoryPolicy; //导入依赖的package包/类
@Override
public void visit(RepositoryPolicy target) {
visitComponent(target);
}