Coverage Report - org.apache.maven.MavenArtifactFilterManager
 
Classes in this File Line Coverage Branch Coverage Complexity
MavenArtifactFilterManager
0 %
0/39
N/A
1
 
 1  
 package org.apache.maven;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 23  
 import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
 24  
 
 25  
 import java.util.Set;
 26  
 import java.util.HashSet;
 27  
 
 28  
 /**
 29  
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
 30  
  * @version $Id: MavenArtifactFilterManager.java 788791 2009-06-26 17:55:26Z jdcasey $
 31  
  * @todo this should probably be a component with some dynamic control of filtering
 32  
  */
 33  0
 public class MavenArtifactFilterManager
 34  
 {
 35  
     public static ArtifactFilter createStandardFilter()
 36  
     {
 37  0
         Set artifacts = createBaseArtifactSet();
 38  
 
 39  0
         artifacts.add( "wagon-file" );
 40  0
         artifacts.add( "wagon-http-lightweight" );
 41  0
         artifacts.add( "wagon-webdav" );
 42  0
         artifacts.add( "wagon-ssh" );
 43  0
         artifacts.add( "wagon-ssh-external" );
 44  0
         artifacts.add( "wagon-ssh-common" );
 45  0
         artifacts.add( "wagon-http-shared" );
 46  0
         artifacts.add( "wagon-webdav-jackrabbit" );
 47  
 
 48  0
         return new ExclusionSetFilter( artifacts );
 49  
     }
 50  
 
 51  
     public static ArtifactFilter createExtensionFilter()
 52  
     {
 53  0
         Set artifacts = createBaseArtifactSet();
 54  
 
 55  
         // It should be safe to include wagon implementations, and since this is used by the extension manager they would
 56  
         // get filtered out otherwise
 57  
         
 58  0
         return new ExclusionSetFilter( artifacts );
 59  
     }
 60  
 
 61  
     private static Set createBaseArtifactSet()
 62  
     {
 63  
         // TODO: configure this from bootstrap or scan lib
 64  0
         Set artifacts = new HashSet();
 65  
 
 66  0
         artifacts.add( "classworlds" );
 67  0
         artifacts.add( "jsch" );
 68  
 //        artifacts.add( "commons-cli" );
 69  0
         artifacts.add( "doxia-sink-api" );
 70  0
         artifacts.add( "doxia-logging-api" );
 71  0
         artifacts.add( "maven-artifact" );
 72  0
         artifacts.add( "maven-artifact-manager" );
 73  0
         artifacts.add( "maven-core" );
 74  0
         artifacts.add( "maven-error-diagnoser" );
 75  0
         artifacts.add( "maven-model" );
 76  0
         artifacts.add( "maven-monitor" );
 77  0
         artifacts.add( "maven-plugin-api" );
 78  0
         artifacts.add( "maven-plugin-descriptor" );
 79  0
         artifacts.add( "maven-plugin-parameter-documenter" );
 80  0
         artifacts.add( "maven-plugin-registry" );
 81  0
         artifacts.add( "maven-profile" );
 82  0
         artifacts.add( "maven-project" );
 83  0
         artifacts.add( "maven-reporting-api" );
 84  0
         artifacts.add( "maven-repository-metadata" );
 85  0
         artifacts.add( "maven-settings" );
 86  0
         artifacts.add( "plexus-container-default" );
 87  0
         artifacts.add( "plexus-interactivity-api" );
 88  0
         artifacts.add( "maven-toolchain" );
 89  0
         artifacts.add( "wagon-provider-api" );
 90  
 
 91  
         // drop the component-api - even though we don't use it directly it is included in out container-default
 92  0
         artifacts.add( "plexus-component-api" );
 93  
         
 94  0
         return artifacts;
 95  
     }
 96  
 }