diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java index 86877a06c..086c3ab3e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java @@ -91,6 +91,10 @@ public class BrowseAction Collection subNamespaces = metadataResolver.getNamespaces( repoId, n ); if ( subNamespaces.size() != 1 ) { + if ( log.isDebugEnabled() ) + { + log.debug( n + " is not collapsible as it has sub-namespaces: " + subNamespaces ); + } return n; } else @@ -98,6 +102,10 @@ public class BrowseAction Collection projects = metadataResolver.getProjects( repoId, n ); if ( projects != null && !projects.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( n + " is not collapsible as it has projects" ); + } return n; } else diff --git a/archiva-modules/metadata/metadata-repository-api/pom.xml b/archiva-modules/metadata/metadata-repository-api/pom.xml index 8bfac606b..0f36161fc 100644 --- a/archiva-modules/metadata/metadata-repository-api/pom.xml +++ b/archiva-modules/metadata/metadata-repository-api/pom.xml @@ -30,5 +30,9 @@ org.apache.archiva metadata-model + + org.slf4j + slf4j-api + diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java index bef603466..e74b366e0 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/DefaultMetadataResolver.java @@ -29,6 +29,8 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata; import org.apache.archiva.metadata.model.ProjectVersionReference; import org.apache.archiva.metadata.repository.filter.ExcludesFilter; import org.apache.archiva.metadata.repository.storage.StorageMetadataResolver; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @plexus.component role="org.apache.archiva.metadata.repository.MetadataResolver" @@ -50,6 +52,8 @@ public class DefaultMetadataResolver */ private StorageMetadataResolver storageResolver; + private static final Logger log = LoggerFactory.getLogger( DefaultMetadataResolver.class ); + public ProjectMetadata getProject( String repoId, String namespace, String projectId ) { // TODO: intercept @@ -112,6 +116,10 @@ public class DefaultMetadataResolver storageResolver.getRootNamespaces( repoId, new ExcludesFilter( namespaces ) ); if ( storageNamespaces != null && !storageNamespaces.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( "Resolved root namespaces from storage: " + storageNamespaces ); + } for ( String n : storageNamespaces ) { metadataRepository.updateNamespace( repoId, n ); @@ -131,6 +139,10 @@ public class DefaultMetadataResolver storageResolver.getNamespaces( repoId, namespace, new ExcludesFilter( exclusions ) ); if ( storageNamespaces != null && !storageNamespaces.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( "Resolved namespaces from storage: " + storageNamespaces ); + } for ( String n : storageNamespaces ) { metadataRepository.updateNamespace( repoId, namespace + "." + n ); @@ -150,6 +162,10 @@ public class DefaultMetadataResolver storageResolver.getProjects( repoId, namespace, new ExcludesFilter( exclusions ) ); if ( storageProjects != null && !storageProjects.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( "Resolved projects from storage: " + storageProjects ); + } for ( String projectId : storageProjects ) { ProjectMetadata projectMetadata = storageResolver.getProject( repoId, namespace, projectId ); @@ -172,6 +188,10 @@ public class DefaultMetadataResolver projectVersions ) ); if ( storageProjectVersions != null && !storageProjectVersions.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( "Resolved project versions from storage: " + storageProjectVersions ); + } for ( String projectVersion : storageProjectVersions ) { ProjectVersionMetadata versionMetadata = @@ -197,6 +217,10 @@ public class DefaultMetadataResolver new ExcludesFilter( createArtifactIdList( artifacts ) ) ); if ( storageArtifacts != null && !storageArtifacts.isEmpty() ) { + if ( log.isDebugEnabled() ) + { + log.debug( "Resolved artifacts from storage: " + storageArtifacts ); + } for ( ArtifactMetadata artifact : storageArtifacts ) { metadataRepository.updateArtifact( repoId, namespace, projectId, projectVersion, artifact );