diff --git a/pom.xml b/pom.xml index d02c01811..5cdf2565d 100644 --- a/pom.xml +++ b/pom.xml @@ -59,6 +59,9 @@ under the License. Maarten Mulders + + Lisa Hardy + diff --git a/src/it/projects/mdep-689-apply-filtering-go-offline-goal/invoker.properties b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/invoker.properties new file mode 100644 index 000000000..4623ccd63 --- /dev/null +++ b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/invoker.properties @@ -0,0 +1,18 @@ +# 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. + +invoker.goals = clean ${project.groupId}:${project.artifactId}:${project.version}:go-offline diff --git a/src/it/projects/mdep-689-apply-filtering-go-offline-goal/pom.xml b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/pom.xml new file mode 100644 index 000000000..a41847d9e --- /dev/null +++ b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/pom.xml @@ -0,0 +1,109 @@ + + + + + + 4.0.0 + org.apache.maven.plugins.dependency + mdep-739-go-offline-respect-classifiers + 1.0.0-SNAPSHOT + Test that dependency:go-offline applies exclude filters + + + skip.this.groupid + dummy-artifact + 1.0 + + + skip.this.groupid.too + dummy-artifact + 1.0 + + + org.junit.jupiter + skip-this-artifact + 1.0 + + + org.junit.jupiter + skip-this-artifact-too + 1.0-SNAPSHOT + + + ch.qos.logback + logback-access + 1.4.7 + skipThisClassifier + + + ch.qos.logback + logback-core + 1.5.6 + skipThisClassifierToo + + + org.slf4j + slf4j-api + 2.0.13 + compile + + + ch.qos.logback + logback-classic + 1.5.4 + system + + ${project.build.directory}/local-repo/junit/junit/4.13.2/junit-4.13.2.jar + + + org.slf4j + slf4j-simple + 2.0.13 + + + ch.qos.logback + logback-examples + 1.4.7 + ear + + + + + + + maven-dependency-plugin + @project.version@ + + skip.this.groupid,skip.this.groupid.too + skip-this-artifact,skip-this-artifact-too + + + system + ear + skipThisClassifier,skipThisClassifierToo + + + + + + diff --git a/src/it/projects/mdep-689-apply-filtering-go-offline-goal/verify.groovy b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/verify.groovy new file mode 100644 index 000000000..1bc9464f7 --- /dev/null +++ b/src/it/projects/mdep-689-apply-filtering-go-offline-goal/verify.groovy @@ -0,0 +1,50 @@ +/* + * 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. + */ + +File file = new File( basedir, "build.log" ) +assert file.exists() + +String buildLog = file.getText( "UTF-8" ) + +// Make sure non-exluded explicit dependencies are resolved +assert buildLog.contains( 'Resolved dependency: slf4j-simple-2.0.13.jar' ) +assert buildLog.contains( 'Resolved dependency: slf4j-api-2.0.13.jar' ) + +// Did group excludes work? +assert !buildLog.contains( 'Resolving artifact skip.this.groupid' ) + +// Did artifact excludes work? +assert !buildLog.contains( 'Resolving artifact org.junit.jupiter:skip-this-artifact' ) + +// Did scope exludes work? +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-classic' ) + +// Did type excludes work? +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-examples' ) + +// Did classifier excludes work? +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-core:jar:skipThisClassifierToo' ) +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-core' ) + +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-access:jar:skipThisClassifier' ) +assert !buildLog.contains( 'Resolving artifact ch.qos.logback:logback-access' ) + + + +return true diff --git a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java index 655458b5d..63a1cfa1b 100644 --- a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java +++ b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/AbstractDependencyFilterMojo.java @@ -136,7 +136,9 @@ public abstract class AbstractDependencyFilterMojo extends AbstractDependencyMoj /** * Scope threshold to exclude, if no value is defined for include. - * An empty string indicates no dependencies (default).
+ * An empty string indicates no dependencies (default). Unlike the other + * exclusion parameters, this property does not support a comma-delimited + * list of scope exclusions. Just one scope may be excluded at a time.
* The scope threshold value being interpreted is the scope as * Maven filters for creating a classpath, not as specified in the pom. In summary: *