Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
NEXUS-3561: rebuild metadata again works properly when run against al…
Browse files Browse the repository at this point in the history
…l repositories

git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus/nexus-app@6548 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
dbradicich committed Jun 3, 2010
1 parent 0f56ee8 commit 722c010
Showing 1 changed file with 19 additions and 15 deletions.
Expand Up @@ -39,25 +39,29 @@ public Object doRun()

// group wins if both given, repoId if group not given. Or null, if none given.
String repoId = StringUtils.isNotBlank( getRepositoryGroupId() ) ? getRepositoryGroupId() : getRepositoryId();

Repository repository = getRepositoryRegistry().getRepository( repoId );

// is this a Maven repository at all?
if ( repoId != null && repository.getRepositoryKind().isFacetAvailable( MavenRepository.class ) )
{
MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class );

mavenRepository.recreateMavenMetadata( req );
}
else if ( repoId != null )

// no repo id, then do all repos
if ( StringUtils.isEmpty( repoId ) )
{
getLogger().warn(
"Repository \"" + repository.getName() + "\" (id=" + repository.getId()
+ ") is not a Maven repository. Skipping it." );
getNexus().rebuildMavenMetadataAllRepositories( req );
}
else
{
getNexus().rebuildMavenMetadataAllRepositories( req );
Repository repository = getRepositoryRegistry().getRepository( repoId );

// is this a Maven repository at all?
if ( repository.getRepositoryKind().isFacetAvailable( MavenRepository.class ) )
{
MavenRepository mavenRepository = repository.adaptToFacet( MavenRepository.class );

mavenRepository.recreateMavenMetadata( req );
}
else
{
getLogger().debug(
"Repository \"" + repository.getName() + "\" (id=" + repository.getId()
+ ") is not a Maven repository. Will not rebuild maven metadata." );
}
}

return null;
Expand Down

0 comments on commit 722c010

Please sign in to comment.