Author: krosenvold Date: Sun Jun 14 17:09:05 2015 New Revision: 1685427 URL: http://svn.apache.org/r1685427 Log: Fixed more ^M's
Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AndFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ExclusionsFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/FilterTransformer.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/OrFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternExclusionsFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternInclusionsFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/TransformableFilter.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformer.java maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformer.java maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformerTest.java maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformerTest.java maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java maven/shared/trunk/maven-filtering/src/test/java/org/apache/maven/shared/filtering/AbstractInterpolatorFilterReaderLineEndingTest.java maven/shared/trunk/maven-filtering/src/test/java/org/apache/maven/shared/filtering/InterpolatorFilterReaderLineEndingTest.java maven/shared/trunk/maven-filtering/src/test/java/org/apache/maven/shared/filtering/MultiDelimiterInterpolatorFilterReaderLineEndingTest.java maven/shared/trunk/maven-project-utils/src/it/setup-plugin/src/main/java/org/apache/maven/shared/project/utils/it/ResolveProjectMojo.java maven/shared/trunk/maven-project-utils/src/it/setup-plugin/src/main/java/org/apache/maven/shared/project/utils/it/ResolveScmMojo.java maven/shared/trunk/maven-project-utils/src/it/setup-plugin/src/main/java/org/apache/maven/shared/project/utils/it/ResolveSiteMojo.java maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/runtime/MavenUtils.java maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ProjectUtils.java maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/ScmUtils.java maven/shared/trunk/maven-project-utils/src/main/java/org/apache/maven/shared/project/utils/SiteUtils.java maven/shared/trunk/maven-project-utils/src/test/java/org/apache/maven/shared/project/utils/ProjectUtilsTest.java maven/shared/trunk/maven-project-utils/src/test/java/org/apache/maven/shared/project/utils/ScmUtilsTest.java maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/introspection/IntrospectionException.java maven/shared/trunk/maven-shared-utils/src/main/java/org/apache/maven/shared/utils/package-info.java Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AndFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AndFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AndFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AndFilter.java Sun Jun 14 17:09:05 2015 @@ -1,70 +1,70 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collections; - -/** - * A filter that combines zero or more other filters using a logical {@code AND}. - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.AndDependencyFilter - * @see org.eclipse.aether.util.filter.AndDependencyFilter - */ -public class AndFilter - implements TransformableFilter -{ - private final Collection<TransformableFilter> filters; - - /** - * The default constructor specifying a collection of filters which all must be matched. - * - * @param filters the filters, may not be {@code null} - */ - public AndFilter( Collection<TransformableFilter> filters ) - { - this.filters = Collections.unmodifiableCollection( filters ); - } - - /** - * Get the filters - * - * @return the filters, never {@code null} - */ - public Collection<TransformableFilter> getFilters() - { - return filters; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, may not be {@code null} - */ - @Override - public <T> T transform( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } - -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collections; + +/** + * A filter that combines zero or more other filters using a logical {@code AND}. + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.AndDependencyFilter + * @see org.eclipse.aether.util.filter.AndDependencyFilter + */ +public class AndFilter + implements TransformableFilter +{ + private final Collection<TransformableFilter> filters; + + /** + * The default constructor specifying a collection of filters which all must be matched. + * + * @param filters the filters, may not be {@code null} + */ + public AndFilter( Collection<TransformableFilter> filters ) + { + this.filters = Collections.unmodifiableCollection( filters ); + } + + /** + * Get the filters + * + * @return the filters, never {@code null} + */ + public Collection<TransformableFilter> getFilters() + { + return filters; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, may not be {@code null} + */ + @Override + public <T> T transform( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } + +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ExclusionsFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ExclusionsFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ExclusionsFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ExclusionsFilter.java Sun Jun 14 17:09:05 2015 @@ -1,65 +1,65 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collections; - -/** - * A simple filter to exclude artifacts based on either artifact id or group id and artifact id. - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.ExclusionsDependencyFilter - * @see org.eclipse.aether.util.filter.ExclusionsDependencyFilter - */ -public class ExclusionsFilter - implements TransformableFilter -{ - private final Collection<String> excludes; - - /** - * The default constructor specifying a collection of keys which must be excluded. - * - * @param excludes the keys to exclude, may not be {@code null} - * @see org.apache.maven.artifact.Artifact#getDependencyConflictId() - */ - public ExclusionsFilter( Collection<String> excludes ) - { - this.excludes = Collections.unmodifiableCollection( excludes ); - } - - public final Collection<String> getExcludes() - { - return excludes; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, may not be {@code null} - */ - @Override - public <T> T transform( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collections; + +/** + * A simple filter to exclude artifacts based on either artifact id or group id and artifact id. + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.ExclusionsDependencyFilter + * @see org.eclipse.aether.util.filter.ExclusionsDependencyFilter + */ +public class ExclusionsFilter + implements TransformableFilter +{ + private final Collection<String> excludes; + + /** + * The default constructor specifying a collection of keys which must be excluded. + * + * @param excludes the keys to exclude, may not be {@code null} + * @see org.apache.maven.artifact.Artifact#getDependencyConflictId() + */ + public ExclusionsFilter( Collection<String> excludes ) + { + this.excludes = Collections.unmodifiableCollection( excludes ); + } + + public final Collection<String> getExcludes() + { + return excludes; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, may not be {@code null} + */ + @Override + public <T> T transform( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/FilterTransformer.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/FilterTransformer.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/FilterTransformer.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/FilterTransformer.java Sun Jun 14 17:09:05 2015 @@ -1,80 +1,80 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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. - */ - -/** - * Provide a mechanism to transform a Filter to a tool specific equivalent using the visitor pattern. - * For example: Aether has its own set of filters. - * - * @author Robert Scholte - * - * @param <T> the tool specific filter - * @since 3.0 - */ -public interface FilterTransformer<T> -{ - /** - * Transform the scopeFilter to T specific implementation - * - * @param scopeFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( ScopeFilter scopeFilter ); - - /** - * Transform the andFilter to T specific implementation - * - * @param andFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( AndFilter andFilter ); - - /** - * Transform the exclusionsFilter to T specific implementation - * - * @param exclusionsFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( ExclusionsFilter exclusionsFilter ); - - /** - * Transform the orFilter to T specific implementation - * - * @param orFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( OrFilter orFilter ); - - /** - * Transform the patternExclusionsFilter to T specific implementation - * - * @param patternExclusionsFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( PatternExclusionsFilter patternExclusionsFilter ); - - /** - * Transform the paternInclusionsFilter to T specific implementation - * - * @param patternInclusionsFilter the filter - * @return the transformed filter, never {@code null} - */ - T transform( PatternInclusionsFilter patternInclusionsFilter ); -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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. + */ + +/** + * Provide a mechanism to transform a Filter to a tool specific equivalent using the visitor pattern. + * For example: Aether has its own set of filters. + * + * @author Robert Scholte + * + * @param <T> the tool specific filter + * @since 3.0 + */ +public interface FilterTransformer<T> +{ + /** + * Transform the scopeFilter to T specific implementation + * + * @param scopeFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( ScopeFilter scopeFilter ); + + /** + * Transform the andFilter to T specific implementation + * + * @param andFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( AndFilter andFilter ); + + /** + * Transform the exclusionsFilter to T specific implementation + * + * @param exclusionsFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( ExclusionsFilter exclusionsFilter ); + + /** + * Transform the orFilter to T specific implementation + * + * @param orFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( OrFilter orFilter ); + + /** + * Transform the patternExclusionsFilter to T specific implementation + * + * @param patternExclusionsFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( PatternExclusionsFilter patternExclusionsFilter ); + + /** + * Transform the paternInclusionsFilter to T specific implementation + * + * @param patternInclusionsFilter the filter + * @return the transformed filter, never {@code null} + */ + T transform( PatternInclusionsFilter patternInclusionsFilter ); +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/OrFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/OrFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/OrFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/OrFilter.java Sun Jun 14 17:09:05 2015 @@ -1,69 +1,69 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collections; - -/** - * A filter that combines zero or more other filters using a logical {@code OR}. - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.OrDependencyFilter - * @see org.eclipse.aether.util.filter.OrDependencyFilter - */ -public class OrFilter implements TransformableFilter -{ - - private final Collection<TransformableFilter> filters; - - /** - * The default constructor specifying a collection of filters of which at least one must match. - * - * @param filters the filters, may not be {@code null} - */ - public OrFilter( Collection<TransformableFilter> filters ) - { - this.filters = Collections.unmodifiableCollection( filters ); - } - - /** - * Get the filters - * - * @return the filters, never {@code null} - */ - public Collection<TransformableFilter> getFilters() - { - return filters; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, may not be {@code null} - */ - @Override - public <T> T transform( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collections; + +/** + * A filter that combines zero or more other filters using a logical {@code OR}. + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.OrDependencyFilter + * @see org.eclipse.aether.util.filter.OrDependencyFilter + */ +public class OrFilter implements TransformableFilter +{ + + private final Collection<TransformableFilter> filters; + + /** + * The default constructor specifying a collection of filters of which at least one must match. + * + * @param filters the filters, may not be {@code null} + */ + public OrFilter( Collection<TransformableFilter> filters ) + { + this.filters = Collections.unmodifiableCollection( filters ); + } + + /** + * Get the filters + * + * @return the filters, never {@code null} + */ + public Collection<TransformableFilter> getFilters() + { + return filters; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, may not be {@code null} + */ + @Override + public <T> T transform( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternExclusionsFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternExclusionsFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternExclusionsFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternExclusionsFilter.java Sun Jun 14 17:09:05 2015 @@ -1,83 +1,83 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collections; - -/** - * A simple filter to exclude artifacts from a list of patterns. The artifact pattern syntax is of the form: - * - * <pre> - * [groupId]:[artifactId]:[extension]:[version] - * </pre> - * <p> - * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern - * segment is treated as an implicit wildcard. Version can be a range in case a {@code VersionScheme} is specified. - * </p> - * <p> - * For example, <code>org.apache.*</code> would match all artifacts whose group id started with - * <code>org.apache.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts. - * </p> - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter - * @see org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter - * @see org.sonatype.aether.version.VersionScheme - * @see org.eclipse.aether.version.VersionScheme - */ -public class PatternExclusionsFilter implements TransformableFilter -{ - - private final Collection<String> excludes; - - /** - * The default constructor specifying a collection of pattern based keys which must be excluded. - * - * @param excludes the excludes, must not be {@code null} - */ - public PatternExclusionsFilter( Collection<String> excludes ) - { - this.excludes = Collections.unmodifiableCollection( excludes ); - } - - /** - * Get the excludes - * - * @return the excluded keys, never {@code null} - */ - public final Collection<String> getExcludes() - { - return excludes; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, must not be {@code null} - */ - @Override - public <T> T transform( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collections; + +/** + * A simple filter to exclude artifacts from a list of patterns. The artifact pattern syntax is of the form: + * + * <pre> + * [groupId]:[artifactId]:[extension]:[version] + * </pre> + * <p> + * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern + * segment is treated as an implicit wildcard. Version can be a range in case a {@code VersionScheme} is specified. + * </p> + * <p> + * For example, <code>org.apache.*</code> would match all artifacts whose group id started with + * <code>org.apache.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts. + * </p> + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter + * @see org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter + * @see org.sonatype.aether.version.VersionScheme + * @see org.eclipse.aether.version.VersionScheme + */ +public class PatternExclusionsFilter implements TransformableFilter +{ + + private final Collection<String> excludes; + + /** + * The default constructor specifying a collection of pattern based keys which must be excluded. + * + * @param excludes the excludes, must not be {@code null} + */ + public PatternExclusionsFilter( Collection<String> excludes ) + { + this.excludes = Collections.unmodifiableCollection( excludes ); + } + + /** + * Get the excludes + * + * @return the excluded keys, never {@code null} + */ + public final Collection<String> getExcludes() + { + return excludes; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, must not be {@code null} + */ + @Override + public <T> T transform( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternInclusionsFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternInclusionsFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternInclusionsFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/PatternInclusionsFilter.java Sun Jun 14 17:09:05 2015 @@ -1,83 +1,83 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collections; - -/** - * A simple filter to include artifacts from a list of patterns. The artifact pattern syntax is of the form: - * - * <pre> - * [groupId]:[artifactId]:[extension]:[version] - * </pre> - * <p> - * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern - * segment is treated as an implicit wildcard. Version can be a range in case a {@code VersionScheme} is specified. - * </p> - * <p> - * For example, <code>org.apache.*</code> would match all artifacts whose group id started with - * <code>org.apache.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts. - * </p> - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter - * @see org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter - * @see org.sonatype.aether.version.VersionScheme - * @see org.eclipse.aether.version.VersionScheme - */ -public class PatternInclusionsFilter implements TransformableFilter -{ - - private final Collection<String> includes; - - /** - * The default constructor specifying a collection of pattern based keys which must be included. - * - * @param includes the includes - */ - public PatternInclusionsFilter( Collection<String> includes ) - { - this.includes = Collections.unmodifiableCollection( includes ); - } - - /** - * Get the includes - * - * @return the includes, - */ - public final Collection<String> getIncludes() - { - return includes; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, must not be {@code null} - */ - @Override - public <T> T transform( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collections; + +/** + * A simple filter to include artifacts from a list of patterns. The artifact pattern syntax is of the form: + * + * <pre> + * [groupId]:[artifactId]:[extension]:[version] + * </pre> + * <p> + * Where each pattern segment is optional and supports full and partial <code>*</code> wildcards. An empty pattern + * segment is treated as an implicit wildcard. Version can be a range in case a {@code VersionScheme} is specified. + * </p> + * <p> + * For example, <code>org.apache.*</code> would match all artifacts whose group id started with + * <code>org.apache.</code> , and <code>:::*-SNAPSHOT</code> would match all snapshot artifacts. + * </p> + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter + * @see org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter + * @see org.sonatype.aether.version.VersionScheme + * @see org.eclipse.aether.version.VersionScheme + */ +public class PatternInclusionsFilter implements TransformableFilter +{ + + private final Collection<String> includes; + + /** + * The default constructor specifying a collection of pattern based keys which must be included. + * + * @param includes the includes + */ + public PatternInclusionsFilter( Collection<String> includes ) + { + this.includes = Collections.unmodifiableCollection( includes ); + } + + /** + * Get the includes + * + * @return the includes, + */ + public final Collection<String> getIncludes() + { + return includes; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, must not be {@code null} + */ + @Override + public <T> T transform( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/ScopeFilter.java Sun Jun 14 17:09:05 2015 @@ -1,125 +1,125 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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.Collection; -import java.util.Collections; - -/** - * Filter based on scope. <strong>Note:</strong> There's no logic for inherited scoped - * - * @author Robert Scholte - * @since 3.0 - * - * @see org.sonatype.aether.util.filter.ScopeDependencyFilter - * @see org.eclipse.aether.util.filter.ScopeDependencyFilter - */ -public class ScopeFilter implements TransformableFilter -{ - private final Collection<String> excluded; - - private final Collection<String> included; - - /** - * - * @param included specific scopes to include or {@code null} to include all - * @param excluded specific scopes to exclude or {@code null} to exclude none - */ - public ScopeFilter( Collection<String> included, Collection<String> excluded ) - { - this.included = ( included == null ? null : Collections.unmodifiableCollection( included ) ); - this.excluded = ( excluded == null ? null : Collections.unmodifiableCollection( excluded ) ); - } - - /** - * Construct a ScopeFilter based on included scopes - * - * @param included the scopes to include, may be {@code null} - * @return the filter, never {@code null} - */ - public static ScopeFilter including( Collection<String> included ) - { - return new ScopeFilter( included, null ); - } - - /** - * Construct a ScopeFilter based on included scopes - * - * @param included the scopes to include, must not be {@code null} - * @return the filter, never {@code null} - */ - public static ScopeFilter including( String... included ) - { - return new ScopeFilter( Arrays.asList( included ), null ); - } - - /** - * Construct a ScopeFilter based on excluded scopes - * - * @param excluded the scopes to exclude, may be {@code null} - * @return the filter, never {@code null} - */ - public static ScopeFilter excluding( Collection<String> excluded ) - { - return new ScopeFilter( null, excluded ); - } - - /** - * Construct a ScopeFilter based on excluded scopes - * - * @param excluded the scopes to exclude, must not be {@code null} - * @return the filter, never {@code null} - */ - public static ScopeFilter excluding( String... excluded ) - { - return new ScopeFilter( null, Arrays.asList( excluded ) ); - } - - /** - * Get the excluded scopes - * - * @return the scopes to exclude, may be {@code null} - */ - public final Collection<String> getExcluded() - { - return excluded; - } - - /** - * Get the included scopes - * - * @return the scopes to include, may be {@code null} - */ - public final Collection<String> getIncluded() - { - return included; - } - - /** - * Transform this filter to a tool specific implementation - * - * @param transformer the transformer, must not be {@code null} - */ - public <T> T transform ( FilterTransformer<T> transformer ) - { - return transformer.transform( this ); - } -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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.Collection; +import java.util.Collections; + +/** + * Filter based on scope. <strong>Note:</strong> There's no logic for inherited scoped + * + * @author Robert Scholte + * @since 3.0 + * + * @see org.sonatype.aether.util.filter.ScopeDependencyFilter + * @see org.eclipse.aether.util.filter.ScopeDependencyFilter + */ +public class ScopeFilter implements TransformableFilter +{ + private final Collection<String> excluded; + + private final Collection<String> included; + + /** + * + * @param included specific scopes to include or {@code null} to include all + * @param excluded specific scopes to exclude or {@code null} to exclude none + */ + public ScopeFilter( Collection<String> included, Collection<String> excluded ) + { + this.included = ( included == null ? null : Collections.unmodifiableCollection( included ) ); + this.excluded = ( excluded == null ? null : Collections.unmodifiableCollection( excluded ) ); + } + + /** + * Construct a ScopeFilter based on included scopes + * + * @param included the scopes to include, may be {@code null} + * @return the filter, never {@code null} + */ + public static ScopeFilter including( Collection<String> included ) + { + return new ScopeFilter( included, null ); + } + + /** + * Construct a ScopeFilter based on included scopes + * + * @param included the scopes to include, must not be {@code null} + * @return the filter, never {@code null} + */ + public static ScopeFilter including( String... included ) + { + return new ScopeFilter( Arrays.asList( included ), null ); + } + + /** + * Construct a ScopeFilter based on excluded scopes + * + * @param excluded the scopes to exclude, may be {@code null} + * @return the filter, never {@code null} + */ + public static ScopeFilter excluding( Collection<String> excluded ) + { + return new ScopeFilter( null, excluded ); + } + + /** + * Construct a ScopeFilter based on excluded scopes + * + * @param excluded the scopes to exclude, must not be {@code null} + * @return the filter, never {@code null} + */ + public static ScopeFilter excluding( String... excluded ) + { + return new ScopeFilter( null, Arrays.asList( excluded ) ); + } + + /** + * Get the excluded scopes + * + * @return the scopes to exclude, may be {@code null} + */ + public final Collection<String> getExcluded() + { + return excluded; + } + + /** + * Get the included scopes + * + * @return the scopes to include, may be {@code null} + */ + public final Collection<String> getIncluded() + { + return included; + } + + /** + * Transform this filter to a tool specific implementation + * + * @param transformer the transformer, must not be {@code null} + */ + public <T> T transform ( FilterTransformer<T> transformer ) + { + return transformer.transform( this ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/TransformableFilter.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/TransformableFilter.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/TransformableFilter.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/TransformableFilter.java Sun Jun 14 17:09:05 2015 @@ -1,45 +1,45 @@ -package org.apache.maven.shared.artifact.filter.resolve; - -/* - * 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. - */ - -/** - * The element interface of the visitor pattern for transforming filters. - * - * @author Robert Scholte - * @since 3.0 - */ -public interface TransformableFilter -{ - /** - * Subclasses should include the following code: - * <pre> - * @Override - * public abstract <T> T transform( FilterTransformer<T> transformer ) - * { - * return transformer.transform( this ); - * } - * </pre> - * - * @param <T> the interface of the tool specific filter - * @param transformer the tool specific transformer, may not be {@code null} - * @return the transformed value, never {@code null} - */ - <T> T transform( FilterTransformer<T> transformer ); -} +package org.apache.maven.shared.artifact.filter.resolve; + +/* + * 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. + */ + +/** + * The element interface of the visitor pattern for transforming filters. + * + * @author Robert Scholte + * @since 3.0 + */ +public interface TransformableFilter +{ + /** + * Subclasses should include the following code: + * <pre> + * @Override + * public abstract <T> T transform( FilterTransformer<T> transformer ) + * { + * return transformer.transform( this ); + * } + * </pre> + * + * @param <T> the interface of the tool specific filter + * @param transformer the tool specific transformer, may not be {@code null} + * @return the transformed value, never {@code null} + */ + <T> T transform( FilterTransformer<T> transformer ); +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformer.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformer.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformer.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformer.java Sun Jun 14 17:09:05 2015 @@ -1,95 +1,95 @@ -package org.apache.maven.shared.artifact.filter.resolve.transform; - -/* - * 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.Collection; - -import org.apache.maven.shared.artifact.filter.resolve.AndFilter; -import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer; -import org.apache.maven.shared.artifact.filter.resolve.OrFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; -import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; -import org.eclipse.aether.graph.DependencyFilter; -import org.eclipse.aether.util.filter.AndDependencyFilter; -import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; -import org.eclipse.aether.util.filter.OrDependencyFilter; -import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter; -import org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter; -import org.eclipse.aether.util.filter.ScopeDependencyFilter; - -/** - * FilterTransformer implementation for Eclipses Aether - * - * @author Robert Scholte - * @since 3.0 - */ -public class EclipseAetherFilterTransformer - implements FilterTransformer<DependencyFilter> -{ - @Override - public AndDependencyFilter transform( AndFilter andFilter ) - { - Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>(); - for ( TransformableFilter filter : andFilter.getFilters() ) - { - filters.add( filter.transform( this ) ); - } - return new AndDependencyFilter( filters ); - } - - @Override - public ExclusionsDependencyFilter transform( ExclusionsFilter filter ) - { - return new ExclusionsDependencyFilter( filter.getExcludes() ); - } - - @Override - public OrDependencyFilter transform( OrFilter orFilter ) - { - Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>(); - for ( TransformableFilter filter : orFilter.getFilters() ) - { - filters.add( filter.transform( this ) ); - } - return new OrDependencyFilter( filters ); - } - - @Override - public ScopeDependencyFilter transform( ScopeFilter filter ) - { - return new ScopeDependencyFilter( filter.getIncluded(), filter.getExcluded() ); - } - - @Override - public DependencyFilter transform( PatternExclusionsFilter filter ) - { - return new PatternExclusionsDependencyFilter( filter.getExcludes() ); - } - - @Override - public DependencyFilter transform( PatternInclusionsFilter filter ) - { - return new PatternInclusionsDependencyFilter( filter.getIncludes() ); - } -} +package org.apache.maven.shared.artifact.filter.resolve.transform; + +/* + * 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.Collection; + +import org.apache.maven.shared.artifact.filter.resolve.AndFilter; +import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer; +import org.apache.maven.shared.artifact.filter.resolve.OrFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; +import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; +import org.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; +import org.eclipse.aether.util.filter.OrDependencyFilter; +import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter; +import org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; + +/** + * FilterTransformer implementation for Eclipses Aether + * + * @author Robert Scholte + * @since 3.0 + */ +public class EclipseAetherFilterTransformer + implements FilterTransformer<DependencyFilter> +{ + @Override + public AndDependencyFilter transform( AndFilter andFilter ) + { + Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>(); + for ( TransformableFilter filter : andFilter.getFilters() ) + { + filters.add( filter.transform( this ) ); + } + return new AndDependencyFilter( filters ); + } + + @Override + public ExclusionsDependencyFilter transform( ExclusionsFilter filter ) + { + return new ExclusionsDependencyFilter( filter.getExcludes() ); + } + + @Override + public OrDependencyFilter transform( OrFilter orFilter ) + { + Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>(); + for ( TransformableFilter filter : orFilter.getFilters() ) + { + filters.add( filter.transform( this ) ); + } + return new OrDependencyFilter( filters ); + } + + @Override + public ScopeDependencyFilter transform( ScopeFilter filter ) + { + return new ScopeDependencyFilter( filter.getIncluded(), filter.getExcluded() ); + } + + @Override + public DependencyFilter transform( PatternExclusionsFilter filter ) + { + return new PatternExclusionsDependencyFilter( filter.getExcludes() ); + } + + @Override + public DependencyFilter transform( PatternInclusionsFilter filter ) + { + return new PatternInclusionsDependencyFilter( filter.getIncludes() ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformer.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformer.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformer.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformer.java Sun Jun 14 17:09:05 2015 @@ -1,95 +1,95 @@ -package org.apache.maven.shared.artifact.filter.resolve.transform; - -/* - * 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.Collection; - -import org.apache.maven.shared.artifact.filter.resolve.AndFilter; -import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer; -import org.apache.maven.shared.artifact.filter.resolve.OrFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; -import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; -import org.sonatype.aether.graph.DependencyFilter; -import org.sonatype.aether.util.filter.AndDependencyFilter; -import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; -import org.sonatype.aether.util.filter.OrDependencyFilter; -import org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter; -import org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter; -import org.sonatype.aether.util.filter.ScopeDependencyFilter; - -/** - * FilterTransformer implementation for Sonatypes Aether - * - * @author Robert Scholte - * @since 3.0 - */ -public class SonatypeAetherFilterTransformer - implements FilterTransformer<DependencyFilter> -{ - @Override - public AndDependencyFilter transform( AndFilter filter ) - { - Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>( filter.getFilters().size() ); - for ( TransformableFilter dependencyFilter : filter.getFilters() ) - { - filters.add( dependencyFilter.transform( this ) ); - } - return new AndDependencyFilter( filters ); - } - - @Override - public ExclusionsDependencyFilter transform( ExclusionsFilter filter ) - { - return new ExclusionsDependencyFilter( filter.getExcludes() ); - } - - @Override - public OrDependencyFilter transform( OrFilter filter ) - { - Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>( filter.getFilters().size() ); - for ( TransformableFilter dependencyFilter : filter.getFilters() ) - { - filters.add( dependencyFilter.transform( this ) ); - } - return new OrDependencyFilter( filters ); - } - - @Override - public ScopeDependencyFilter transform( ScopeFilter filter ) - { - return new ScopeDependencyFilter( filter.getIncluded(), filter.getExcluded() ); - } - - @Override - public DependencyFilter transform( PatternExclusionsFilter filter ) - { - return new PatternExclusionsDependencyFilter( filter.getExcludes() ); - } - - @Override - public DependencyFilter transform( PatternInclusionsFilter filter ) - { - return new PatternInclusionsDependencyFilter( filter.getIncludes() ); - } -} +package org.apache.maven.shared.artifact.filter.resolve.transform; + +/* + * 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.Collection; + +import org.apache.maven.shared.artifact.filter.resolve.AndFilter; +import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer; +import org.apache.maven.shared.artifact.filter.resolve.OrFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; +import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; +import org.sonatype.aether.graph.DependencyFilter; +import org.sonatype.aether.util.filter.AndDependencyFilter; +import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; +import org.sonatype.aether.util.filter.OrDependencyFilter; +import org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter; +import org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter; +import org.sonatype.aether.util.filter.ScopeDependencyFilter; + +/** + * FilterTransformer implementation for Sonatypes Aether + * + * @author Robert Scholte + * @since 3.0 + */ +public class SonatypeAetherFilterTransformer + implements FilterTransformer<DependencyFilter> +{ + @Override + public AndDependencyFilter transform( AndFilter filter ) + { + Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>( filter.getFilters().size() ); + for ( TransformableFilter dependencyFilter : filter.getFilters() ) + { + filters.add( dependencyFilter.transform( this ) ); + } + return new AndDependencyFilter( filters ); + } + + @Override + public ExclusionsDependencyFilter transform( ExclusionsFilter filter ) + { + return new ExclusionsDependencyFilter( filter.getExcludes() ); + } + + @Override + public OrDependencyFilter transform( OrFilter filter ) + { + Collection<DependencyFilter> filters = new ArrayList<DependencyFilter>( filter.getFilters().size() ); + for ( TransformableFilter dependencyFilter : filter.getFilters() ) + { + filters.add( dependencyFilter.transform( this ) ); + } + return new OrDependencyFilter( filters ); + } + + @Override + public ScopeDependencyFilter transform( ScopeFilter filter ) + { + return new ScopeDependencyFilter( filter.getIncluded(), filter.getExcluded() ); + } + + @Override + public DependencyFilter transform( PatternExclusionsFilter filter ) + { + return new PatternExclusionsDependencyFilter( filter.getExcludes() ); + } + + @Override + public DependencyFilter transform( PatternInclusionsFilter filter ) + { + return new PatternInclusionsDependencyFilter( filter.getIncludes() ); + } +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformerTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformerTest.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformerTest.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherFilterTransformerTest.java Sun Jun 14 17:09:05 2015 @@ -1,100 +1,100 @@ -package org.apache.maven.shared.artifact.filter.resolve.transform; - -/* - * 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.Collections; - -import org.apache.maven.shared.artifact.filter.resolve.AndFilter; -import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.OrFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; -import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; -import org.eclipse.aether.util.filter.AndDependencyFilter; -import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; -import org.eclipse.aether.util.filter.OrDependencyFilter; -import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter; -import org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter; -import org.eclipse.aether.util.filter.ScopeDependencyFilter; -import org.junit.Test; - -public class EclipseAetherFilterTransformerTest -{ - - private EclipseAetherFilterTransformer transformer = new EclipseAetherFilterTransformer(); - - @Test - public void testTransformAndFilter() - { - AndFilter filter = new AndFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), - ScopeFilter.including( "test" ) ) ); - - AndDependencyFilter dependencyFilter = (AndDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformExclusionsFilter() - { - ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "runtime" ) ); - - ExclusionsDependencyFilter dependencyFilter = (ExclusionsDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformOrFilter() - { - OrFilter filter = new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), - ScopeFilter.including( "test" ) ) ); - - OrDependencyFilter dependencyFilter = (OrDependencyFilter) filter.transform( transformer ); - - } - - @Test - public void testTransformScopeFilter() - { - ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) ); - - ScopeDependencyFilter dependencyFilter = (ScopeDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformPatternExclusionsFilter() - { - PatternExclusionsFilter filter = - new PatternExclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); - - PatternExclusionsDependencyFilter dependencyFilter = - (PatternExclusionsDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformPatternInclusionsFilter() - { - PatternInclusionsFilter filter = - new PatternInclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); - - PatternInclusionsDependencyFilter dependencyFilter = - (PatternInclusionsDependencyFilter) filter.transform( transformer ); - } - -} +package org.apache.maven.shared.artifact.filter.resolve.transform; + +/* + * 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.Collections; + +import org.apache.maven.shared.artifact.filter.resolve.AndFilter; +import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.OrFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; +import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; +import org.eclipse.aether.util.filter.AndDependencyFilter; +import org.eclipse.aether.util.filter.ExclusionsDependencyFilter; +import org.eclipse.aether.util.filter.OrDependencyFilter; +import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter; +import org.eclipse.aether.util.filter.PatternInclusionsDependencyFilter; +import org.eclipse.aether.util.filter.ScopeDependencyFilter; +import org.junit.Test; + +public class EclipseAetherFilterTransformerTest +{ + + private EclipseAetherFilterTransformer transformer = new EclipseAetherFilterTransformer(); + + @Test + public void testTransformAndFilter() + { + AndFilter filter = new AndFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), + ScopeFilter.including( "test" ) ) ); + + AndDependencyFilter dependencyFilter = (AndDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformExclusionsFilter() + { + ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "runtime" ) ); + + ExclusionsDependencyFilter dependencyFilter = (ExclusionsDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformOrFilter() + { + OrFilter filter = new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), + ScopeFilter.including( "test" ) ) ); + + OrDependencyFilter dependencyFilter = (OrDependencyFilter) filter.transform( transformer ); + + } + + @Test + public void testTransformScopeFilter() + { + ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) ); + + ScopeDependencyFilter dependencyFilter = (ScopeDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformPatternExclusionsFilter() + { + PatternExclusionsFilter filter = + new PatternExclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); + + PatternExclusionsDependencyFilter dependencyFilter = + (PatternExclusionsDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformPatternInclusionsFilter() + { + PatternInclusionsFilter filter = + new PatternInclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); + + PatternInclusionsDependencyFilter dependencyFilter = + (PatternInclusionsDependencyFilter) filter.transform( transformer ); + } + +} Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformerTest.java URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformerTest.java?rev=1685427&r1=1685426&r2=1685427&view=diff ============================================================================== --- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformerTest.java (original) +++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherFilterTransformerTest.java Sun Jun 14 17:09:05 2015 @@ -1,100 +1,100 @@ -package org.apache.maven.shared.artifact.filter.resolve.transform; - -/* - * 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.Collections; - -import org.apache.maven.shared.artifact.filter.resolve.AndFilter; -import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.OrFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; -import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; -import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; -import org.sonatype.aether.util.filter.AndDependencyFilter; -import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; -import org.sonatype.aether.util.filter.OrDependencyFilter; -import org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter; -import org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter; -import org.sonatype.aether.util.filter.ScopeDependencyFilter; -import org.junit.Test; - -public class SonatypeAetherFilterTransformerTest -{ - - private SonatypeAetherFilterTransformer transformer = new SonatypeAetherFilterTransformer(); - - @Test - public void testTransformAndFilter() - { - AndFilter filter = new AndFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), - ScopeFilter.including( "test" ) ) ); - - AndDependencyFilter dependencyFilter = (AndDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformExclusionsFilter() - { - ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "runtime" ) ); - - ExclusionsDependencyFilter dependencyFilter = (ExclusionsDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformOrFilter() - { - OrFilter filter = new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), - ScopeFilter.including( "test" ) ) ); - - OrDependencyFilter dependencyFilter = (OrDependencyFilter) filter.transform( transformer ); - - } - - @Test - public void testTransformScopeFilter() - { - ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) ); - - ScopeDependencyFilter dependencyFilter = (ScopeDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformPatternExclusionsFilter() - { - PatternExclusionsFilter filter = - new PatternExclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); - - PatternExclusionsDependencyFilter dependencyFilter = - (PatternExclusionsDependencyFilter) filter.transform( transformer ); - } - - @Test - public void testTransformPatternInclusionsFilter() - { - PatternInclusionsFilter filter = - new PatternInclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); - - PatternInclusionsDependencyFilter dependencyFilter = - (PatternInclusionsDependencyFilter) filter.transform( transformer ); - } - -} +package org.apache.maven.shared.artifact.filter.resolve.transform; + +/* + * 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.Collections; + +import org.apache.maven.shared.artifact.filter.resolve.AndFilter; +import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.OrFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter; +import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter; +import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter; +import org.sonatype.aether.util.filter.AndDependencyFilter; +import org.sonatype.aether.util.filter.ExclusionsDependencyFilter; +import org.sonatype.aether.util.filter.OrDependencyFilter; +import org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter; +import org.sonatype.aether.util.filter.PatternInclusionsDependencyFilter; +import org.sonatype.aether.util.filter.ScopeDependencyFilter; +import org.junit.Test; + +public class SonatypeAetherFilterTransformerTest +{ + + private SonatypeAetherFilterTransformer transformer = new SonatypeAetherFilterTransformer(); + + @Test + public void testTransformAndFilter() + { + AndFilter filter = new AndFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), + ScopeFilter.including( "test" ) ) ); + + AndDependencyFilter dependencyFilter = (AndDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformExclusionsFilter() + { + ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "runtime" ) ); + + ExclusionsDependencyFilter dependencyFilter = (ExclusionsDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformOrFilter() + { + OrFilter filter = new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ), + ScopeFilter.including( "test" ) ) ); + + OrDependencyFilter dependencyFilter = (OrDependencyFilter) filter.transform( transformer ); + + } + + @Test + public void testTransformScopeFilter() + { + ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) ); + + ScopeDependencyFilter dependencyFilter = (ScopeDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformPatternExclusionsFilter() + { + PatternExclusionsFilter filter = + new PatternExclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); + + PatternExclusionsDependencyFilter dependencyFilter = + (PatternExclusionsDependencyFilter) filter.transform( transformer ); + } + + @Test + public void testTransformPatternInclusionsFilter() + { + PatternInclusionsFilter filter = + new PatternInclusionsFilter( Collections.singletonList( "org.apache.maven:*" ) ); + + PatternInclusionsDependencyFilter dependencyFilter = + (PatternInclusionsDependencyFilter) filter.transform( transformer ); + } + +}