diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter')
7 files changed, 0 insertions, 629 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java deleted file mode 100644 index 95872dbb..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AbstractScopeArtifactFilter.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to only retain objects in the given artifactScope or better. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -abstract class AbstractScopeArtifactFilter - implements ArtifactFilter -{ - - private boolean compileScope; - - private boolean runtimeScope; - - private boolean testScope; - - private boolean providedScope; - - private boolean systemScope; - - void addScopeInternal( String scope ) - { - if ( Artifact.SCOPE_COMPILE.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - } - else if ( Artifact.SCOPE_RUNTIME.equals( scope ) ) - { - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_RUNTIME_PLUS_SYSTEM.equals( scope ) ) - { - systemScope = true; - compileScope = true; - runtimeScope = true; - } - else if ( Artifact.SCOPE_TEST.equals( scope ) ) - { - systemScope = true; - providedScope = true; - compileScope = true; - runtimeScope = true; - testScope = true; - } - } - - public boolean include( Artifact artifact ) - { - if ( Artifact.SCOPE_COMPILE.equals( artifact.getScope() ) ) - { - return compileScope; - } - else if ( Artifact.SCOPE_RUNTIME.equals( artifact.getScope() ) ) - { - return runtimeScope; - } - else if ( Artifact.SCOPE_TEST.equals( artifact.getScope() ) ) - { - return testScope; - } - else if ( Artifact.SCOPE_PROVIDED.equals( artifact.getScope() ) ) - { - return providedScope; - } - else if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) ) - { - return systemScope; - } - else - { - return true; - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java deleted file mode 100644 index 5c6689de..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/AndArtifactFilter.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * Apply multiple filters. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class AndArtifactFilter - implements ArtifactFilter -{ - private Set<ArtifactFilter> filters; - - public AndArtifactFilter() - { - this.filters = new LinkedHashSet<ArtifactFilter>(); - } - - public AndArtifactFilter( List<ArtifactFilter> filters ) - { - this.filters = new LinkedHashSet<ArtifactFilter>( filters ); - } - - public boolean include( Artifact artifact ) - { - boolean include = true; - for ( Iterator<ArtifactFilter> i = filters.iterator(); i.hasNext() && include; ) - { - ArtifactFilter filter = i.next(); - if ( !filter.include( artifact ) ) - { - include = false; - } - } - return include; - } - - public void add( ArtifactFilter artifactFilter ) - { - filters.add( artifactFilter ); - } - - public List<ArtifactFilter> getFilters() - { - return new ArrayList<ArtifactFilter>( filters ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + filters.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof AndArtifactFilter ) ) - { - return false; - } - - AndArtifactFilter other = (AndArtifactFilter) obj; - - return filters.equals( other.filters ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java deleted file mode 100644 index fb0afcfb..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/CumulativeScopeArtifactFilter.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -/** - * Filter to only retain objects in the given scope or better. This implementation allows the accumulation of multiple - * scopes and their associated implied scopes, so that the user can filter apply a series of implication rules in a - * single step. This should be a more efficient implementation of multiple standard {@link ScopeArtifactFilter} - * instances ORed together. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @author jdcasey - */ -public class CumulativeScopeArtifactFilter - extends AbstractScopeArtifactFilter -{ - - private Set<String> scopes; - - /** - * Create a new filter with the specified scopes and their implied scopes enabled. - * - * @param scopes The scopes to enable, along with all implied scopes, may be {@code null}. - */ - public CumulativeScopeArtifactFilter( Collection<String> scopes ) - { - this.scopes = new HashSet<String>(); - - addScopes( scopes ); - } - - /** - * Creates a new filter that combines the specified filters. - * - * @param filters The filters to combine, may be {@code null}. - */ - public CumulativeScopeArtifactFilter( CumulativeScopeArtifactFilter... filters ) - { - this.scopes = new HashSet<String>(); - - if ( filters != null ) - { - for ( CumulativeScopeArtifactFilter filter : filters ) - { - addScopes( filter.getScopes() ); - } - } - } - - private void addScopes( Collection<String> scopes ) - { - if ( scopes != null ) - { - for ( String scope : scopes ) - { - addScope( scope ); - } - } - } - - private void addScope( String scope ) - { - this.scopes.add( scope ); - - addScopeInternal( scope ); - } - - public Set<String> getScopes() - { - return scopes; - } - - @Override - public int hashCode() - { - int hash = 17; - - hash = hash * 31 + scopes.hashCode(); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof CumulativeScopeArtifactFilter ) ) - { - return false; - } - - CumulativeScopeArtifactFilter that = (CumulativeScopeArtifactFilter) obj; - - return scopes.equals( that.scopes ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java deleted file mode 100644 index b6ef02e5..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExcludesArtifactFilter.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.List; - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to exclude from a list of artifact patterns. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - * @todo I think this is equiv. to exclusion set filter in maven-core - */ -public class ExcludesArtifactFilter - extends IncludesArtifactFilter -{ - public ExcludesArtifactFilter( List<String> patterns ) - { - super( patterns ); - } - - public boolean include( Artifact artifact ) - { - return !super.include( artifact ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java deleted file mode 100644 index c3dc9812..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * @author <a href="mailto:jason@maven.org">Jason van Zyl</a> - */ -public class ExclusionSetFilter - implements ArtifactFilter -{ - private Set<String> excludes; - - public ExclusionSetFilter( String[] excludes ) - { - this.excludes = new LinkedHashSet<String>( Arrays.asList( excludes ) ); - } - - public ExclusionSetFilter( Set<String> excludes ) - { - this.excludes = excludes; - } - - public boolean include( Artifact artifact ) - { - String id = artifact.getArtifactId(); - - if ( excludes.contains( id ) ) - { - return false; - } - - id = artifact.getGroupId() + ':' + id; - - return !excludes.contains( id ); - - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + excludes.hashCode(); - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof ExclusionSetFilter ) ) - { - return false; - } - - ExclusionSetFilter other = (ExclusionSetFilter) obj; - - return excludes.equals( other.excludes ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java deleted file mode 100644 index 403e1251..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/IncludesArtifactFilter.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; - -/** - * Filter to include from a list of artifact patterns. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class IncludesArtifactFilter - implements ArtifactFilter -{ - private final Set<String> patterns; - - public IncludesArtifactFilter( List<String> patterns ) - { - this.patterns = new LinkedHashSet<String>( patterns ); - } - - public boolean include( Artifact artifact ) - { - String id = artifact.getGroupId() + ":" + artifact.getArtifactId(); - - boolean matched = false; - for ( Iterator<String> i = patterns.iterator(); i.hasNext() & !matched; ) - { - // TODO: what about wildcards? Just specifying groups? versions? - if ( id.equals( i.next() ) ) - { - matched = true; - } - } - return matched; - } - - public List<String> getPatterns() - { - return new ArrayList<String>( patterns ); - } - - @Override - public int hashCode() - { - int hash = 17; - hash = hash * 31 + patterns.hashCode(); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - // make sure IncludesArtifactFilter is not equal ExcludesArtifactFilter! - if ( obj == null || getClass() != obj.getClass() ) - { - return false; - } - - IncludesArtifactFilter other = (IncludesArtifactFilter) obj; - - return patterns.equals( other.patterns ); - } -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java deleted file mode 100644 index 1d131b71..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/artifact/resolver/filter/ScopeArtifactFilter.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.apache.maven.artifact.resolver.filter; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Filter to only retain objects in the given artifactScope or better. - * - * @author <a href="mailto:brett@apache.org">Brett Porter</a> - */ -public class ScopeArtifactFilter - extends AbstractScopeArtifactFilter -{ - - private final String scope; - - public ScopeArtifactFilter( String scope ) - { - this.scope = scope; - - addScopeInternal( scope ); - } - - public String getScope() - { - return scope; - } - - @Override - public int hashCode() - { - int hash = 17; - - hash = hash * 31 + ( scope != null ? scope.hashCode() : 0 ); - - return hash; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - { - return true; - } - - if ( !( obj instanceof ScopeArtifactFilter ) ) - { - return false; - } - - ScopeArtifactFilter other = (ScopeArtifactFilter) obj; - - return equals( scope, other.scope ); - } - - private static <T> boolean equals( T str1, T str2 ) - { - return str1 != null ? str1.equals( str2 ) : str2 == null; - } - -} |