use of org.sonatype.nexus.repository.maven.MavenMetadataRebuildFacet in project nexus-public by sonatype.
the class DataStoreMavenTestHelper method read.
@Override
public Payload read(final Repository repository, final String path) throws IOException {
MavenContentFacet mavenFacet = repository.facet(MavenContentFacet.class);
Optional<MavenMetadataRebuildFacet> metadataRebuildFacet = repository.optionalFacet(MavenMetadataRebuildFacet.class);
if (metadataRebuildFacet.isPresent()) {
metadataRebuildFacet.get().maybeRebuildMavenMetadata(prependIfMissing(path, ASSET_PATH_PREFIX), false, true);
}
MavenPath mavenPath = mavenFacet.getMavenPathParser().parsePath(path);
return mavenFacet.get(mavenPath).orElse(null);
}
use of org.sonatype.nexus.repository.maven.MavenMetadataRebuildFacet in project nexus-public by sonatype.
the class RebuildMaven2MetadataTask method execute.
@Override
protected void execute(final Repository repository) {
MavenMetadataRebuildFacet mavenHostedFacet = repository.facet(MavenMetadataRebuildFacet.class);
mavenHostedFacet.rebuildMetadata(getConfiguration().getString(GROUPID_FIELD_ID), getConfiguration().getString(ARTIFACTID_FIELD_ID), getConfiguration().getString(BASEVERSION_FIELD_ID), getConfiguration().getBoolean(REBUILD_CHECKSUMS, false), false);
}
use of org.sonatype.nexus.repository.maven.MavenMetadataRebuildFacet in project nexus-public by sonatype.
the class MavenContentDirector method afterMove.
@Override
public void afterMove(final List<Map<String, String>> components, final Repository destination) {
MavenMetadataRebuildFacet facet = destination.facet(MavenMetadataRebuildFacet.class);
components.stream().map(component -> Pair.of(component.get("group"), component.get("name"))).distinct().forEach(pair -> facet.rebuildMetadata(pair.getLeft(), pair.getRight(), null, false));
}
Aggregations