Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

NEXUS-5241: Simple fix to not have some events stored to Timeline.

Simply adding extra checks: event to be stored relates to a path
that is:

* NOT maven repository metadata file (maven-metadata.xml)
* NOT maven artifact signature file (*.asc)
* NOT maven checksum file (*.sha1 or *.md5)

Note: this change makes Timeline Maven-support dependant. Today, this is
fine as Maven support happens to be in Core, but once moved out, this
solution will either require to have Timeline plugin depend on Maven plugin
(which is wrong) or removal of this change will be needed.
  • Loading branch information...
commit c37eca1d4557eab2331e34b50971dbfa2894aa05 1 parent a6e415f
Tamas Cservenak authored September 05, 2012
8  ...s/nexus-timeline-plugin/src/main/java/org/sonatype/nexus/feeds/record/ItemChangesFeedEventInspector.java
@@ -25,10 +25,13 @@
25 25
 import org.sonatype.nexus.proxy.events.RepositoryItemEventStore;
26 26
 import org.sonatype.nexus.proxy.item.StorageFileItem;
27 27
 import org.sonatype.nexus.proxy.item.uid.IsHiddenAttribute;
  28
+import org.sonatype.nexus.proxy.maven.uid.IsMavenArtifactSignatureAttribute;
  29
+import org.sonatype.nexus.proxy.maven.uid.IsMavenChecksumAttribute;
  30
+import org.sonatype.nexus.proxy.maven.uid.IsMavenRepositoryMetadataAttribute;
28 31
 import org.sonatype.plexus.appevents.Event;
29 32
 
30 33
 /**
31  
- * Event inspector that creates feeds about item changes.
  34
+ * Event inspector that persists item events into Timeline.
32 35
  *
33 36
  * @author Juven Xu
34 37
  * @author cstamas
@@ -68,6 +71,9 @@ private void inspectForNexus( Event<?> evt )
68 71
         // filter out links and dirs/collections and hidden files
69 72
         if ( StorageFileItem.class.isAssignableFrom( ievt.getItem().getClass() )
70 73
             && !ievt.getItemUid().getBooleanAttributeValue( IsHiddenAttribute.class )
  74
+            && !ievt.getItemUid().getBooleanAttributeValue( IsMavenRepositoryMetadataAttribute.class ) // "maven-metadata.xml"
  75
+            && !ievt.getItemUid().getBooleanAttributeValue( IsMavenArtifactSignatureAttribute.class ) // "*.asc"
  76
+            && !ievt.getItemUid().getBooleanAttributeValue( IsMavenChecksumAttribute.class ) // "*.sha1" or "*.md5" 
71 77
             && !( (StorageFileItem) ievt.getItem() ).isContentGenerated() )
72 78
         {
73 79
             StorageFileItem pomItem = (StorageFileItem) ievt.getItem();

0 notes on commit c37eca1

ifedorenko

Will it make more sense to check for specific items to include in the timeline instead of items to exclude?

Please sign in to comment.
Something went wrong with that request. Please try again.