Java Code Examples for org.sonatype.nexus.repository.Repository#attach()

The following examples show how to use org.sonatype.nexus.repository.Repository#attach() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AptProxyRecipe.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void apply(final Repository repository) throws Exception {
  repository.attach(securityFacet.get());
  repository.attach(configure(viewFacet.get()));
  repository.attach(httpClientFacet.get());
  repository.attach(negativeCacheFacet.get());
  repository.attach(proxyFacet.get());
  repository.attach(proxySnapshotFacet.get());
  repository.attach(aptFacet.get());
  repository.attach(aptRestoreFacet.get());
  repository.attach(storageFacet.get());
  repository.attach(attributesFacet.get());
  repository.attach(componentMaintenance.get());
  repository.attach(searchFacet.get());
  repository.attach(purgeUnusedFacet.get());
}
 
Example 2
Source File: RepositoryManagerImpl.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Construct a new repository from configuration.
 */
private Repository newRepository(final Configuration configuration) throws Exception {
  String recipeName = configuration.getRecipeName();
  Recipe recipe = recipe(recipeName);
  log.debug("Using recipe: [{}] {}", recipeName, recipe);

  Repository repository = factory.create(recipe.getType(), recipe.getFormat());

  // attach mandatory facets
  repository.attach(configFacet.get());

  // apply recipe to repository
  recipe.apply(repository);

  // verify required facets
  repository.facet(ViewFacet.class);

  // ensure configuration sanity, once all facets are attached
  repository.validate(configuration);

  // initialize repository
  repository.init(configuration);

  return repository;
}
 
Example 3
Source File: AptProxyRecipe.java    From nexus-repository-apt with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void apply(Repository repository) throws Exception {
  repository.attach(securityFacet.get());
  repository.attach(configure(viewFacet.get()));
  repository.attach(httpClientFacet.get());
  repository.attach(negativeCacheFacet.get());
  repository.attach(proxyFacet.get());
  repository.attach(proxySnapshotFacet.get());
  repository.attach(aptFacet.get());
  repository.attach(storageFacet.get());
  repository.attach(attributesFacet.get());
  repository.attach(componentMaintenance.get());
  repository.attach(searchFacet.get());
  repository.attach(purgeUnusedFacet.get());
}
 
Example 4
Source File: AptHostedRecipe.java    From nexus-repository-apt with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void apply(Repository repository) throws Exception {
  repository.attach(securityFacet.get());
  repository.attach(configure(viewFacet.get()));
  repository.attach(storageFacet.get());
  repository.attach(aptFacet.get());
  repository.attach(aptHostedFacet.get());
  repository.attach(aptSigningFacet.get());
  repository.attach(snapshotFacet.get());
  repository.attach(attributesFacet.get());
  repository.attach(componentMaintenance.get());
  repository.attach(searchFacet.get());
}
 
Example 5
Source File: AptHostedRecipe.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void apply(final Repository repository) throws Exception {
  repository.attach(securityFacet.get());
  repository.attach(configure(viewFacet.get()));
  repository.attach(storageFacet.get());
  repository.attach(aptFacet.get());
  repository.attach(aptRestoreFacet.get());
  repository.attach(aptHostedFacet.get());
  repository.attach(aptSigningFacet.get());
  repository.attach(snapshotFacet.get());
  repository.attach(attributesFacet.get());
  repository.attach(componentMaintenance.get());
  repository.attach(searchFacet.get());
}
 
Example 6
Source File: CocoapodsProxyRecipe.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void apply(final Repository repository) throws Exception {
  repository.attach(securityFacet.get());
  repository.attach(configure(viewFacet.get()));
  repository.attach(httpClientFacet.get());
  repository.attach(negativeCacheFacet.get());
  repository.attach(proxyFacet.get());
  repository.attach(cocoapodsFacet.get());
  repository.attach(storageFacet.get());
  repository.attach(attributesFacet.get());
  repository.attach(componentMaintenance.get());
  repository.attach(searchFacet.get());
  repository.attach(purgeUnusedFacet.get());
}