diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 217636c..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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. - */ - -asfMavenTlpPlgnBuild(jdks:[ "17", "21" ], maven: [ "4.0.x" ], siteJdk:[ "17" ], siteMvn:[ "4.0.x" ]) diff --git a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java index 1e1218d..58a3d87 100644 --- a/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java +++ b/src/main/java/org/apache/maven/plugins/resources/TestResourcesMojo.java @@ -20,6 +20,7 @@ import java.nio.file.Path; import java.util.List; +import java.util.Map; import org.apache.maven.api.Language; import org.apache.maven.api.ProjectScope; @@ -53,6 +54,7 @@ public class TestResourcesMojo extends ResourcesMojo { /** * Set this to 'true' to bypass copying of test resources. * Its use is NOT RECOMMENDED, but quite convenient on occasion. + * * @since 2.6 */ @Parameter(property = "maven.test.skip", defaultValue = "false") @@ -62,7 +64,7 @@ public class TestResourcesMojo extends ResourcesMojo { * {@inheritDoc} */ public void execute() throws MojoException { - if (skip) { + if (skip || isTestSkip()) { getLog().info("Not copying test resources"); return; } @@ -75,6 +77,23 @@ public void execute() throws MojoException { super.doExecute(); } + /** + * Returns {@code true} if test resource copying should be skipped. + * Checks both the inherited {@code skip} parameter (bound to {@code maven.resources.skip}) + * and the {@code maven.test.skip} property from the session. + * + * @return {@code true} if test resources should not be copied + */ + private boolean isTestSkip() { + if (isSkip()) { + return true; + } + Map userProps = session.getUserProperties(); + Map sysProps = session.getSystemProperties(); + String testSkip = userProps.getOrDefault("maven.test.skip", sysProps.get("maven.test.skip")); + return Boolean.parseBoolean(testSkip); + } + /** {@inheritDoc} */ public Path getOutputDirectory() { return outputDirectory;