From 23cdae68978a5eff25293e43086a15a67a2a2ed3 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Wed, 14 Aug 2024 19:21:27 +0200 Subject: [PATCH 1/2] [MDEPLOY-319] Remove unfinished test - MDEPLOY-318-invalid-pom Test was committed by accident with other work --- .../invoker.properties | 18 ----- src/it/MDEPLOY-318-invalid-pom/pom.xml | 75 ------------------- 2 files changed, 93 deletions(-) delete mode 100644 src/it/MDEPLOY-318-invalid-pom/invoker.properties delete mode 100644 src/it/MDEPLOY-318-invalid-pom/pom.xml diff --git a/src/it/MDEPLOY-318-invalid-pom/invoker.properties b/src/it/MDEPLOY-318-invalid-pom/invoker.properties deleted file mode 100644 index c32d7bb5..00000000 --- a/src/it/MDEPLOY-318-invalid-pom/invoker.properties +++ /dev/null @@ -1,18 +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. - -invoker.goals = clean jar:jar deploy:deploy diff --git a/src/it/MDEPLOY-318-invalid-pom/pom.xml b/src/it/MDEPLOY-318-invalid-pom/pom.xml deleted file mode 100644 index 2ac4f83c..00000000 --- a/src/it/MDEPLOY-318-invalid-pom/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - 4.0.0 - - org.apache.maven.its.deploy.invalid-pom - test - 1.0 - pom - - - Tests the deployment of a simple release POM. - - - - true - - - - - it - file:///${basedir}/target/repo - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - @mavenCompilerPluginVersion@ - - - org.apache.maven.plugins - maven-deploy-plugin - @project.version@ - - - org.apache.maven.plugins - maven-install-plugin - @mavenInstallPluginVersion@ - - - org.apache.maven.plugins - maven-resources-plugin - @mavenResourcesPluginVersion@ - - - org.apache.maven.plugins - maven-surefire-plugin - @mavenSurefirePluginVersion@ - - - - - From c814011f235b00c83b37f21cd03c4be5713855fb Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 15 Aug 2024 12:05:24 +0200 Subject: [PATCH 2/2] [MDEPLOY-322] Use parent POM 43 (#74) Also, some ITs were not updated with latest changes and failed. Unsure where were they before this change? --- https://issues.apache.org/jira/browse/MDEPLOY-322 --- pom.xml | 21 ++++--------------- src/it/no-main-artifact-1/verify.groovy | 2 +- src/it/no-main-artifact-2/verify.groovy | 2 +- .../maven/plugins/deploy/DeployFileMojo.java | 2 ++ .../maven/plugins/deploy/DeployMojo.java | 1 + 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 72dfbfe0..dc0c27d8 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven.plugins maven-plugins - 42 + 43 @@ -70,10 +70,10 @@ under the License. 8 3.9.6 - + + 1.9.18 + 1.7.36 - - 1.9.20 ${version.maven-antrun-plugin} @@ -210,19 +210,6 @@ under the License. - - - - org.apache.maven.plugins - maven-compiler-plugin - - none - true - - - - - run-its diff --git a/src/it/no-main-artifact-1/verify.groovy b/src/it/no-main-artifact-1/verify.groovy index 9442aa7d..7274ba5c 100644 --- a/src/it/no-main-artifact-1/verify.groovy +++ b/src/it/no-main-artifact-1/verify.groovy @@ -19,5 +19,5 @@ def buildLog = new File ( basedir, "build.log") -assert buildLog.text.contains( "The packaging plugin for this project did not assign " +assert buildLog.text.contains( "The packaging plugin for project test did not assign " + "a main file to the project but it has attachments. Change packaging to 'pom'." ) \ No newline at end of file diff --git a/src/it/no-main-artifact-2/verify.groovy b/src/it/no-main-artifact-2/verify.groovy index 9442aa7d..7274ba5c 100644 --- a/src/it/no-main-artifact-2/verify.groovy +++ b/src/it/no-main-artifact-2/verify.groovy @@ -19,5 +19,5 @@ def buildLog = new File ( basedir, "build.log") -assert buildLog.text.contains( "The packaging plugin for this project did not assign " +assert buildLog.text.contains( "The packaging plugin for project test did not assign " + "a main file to the project but it has attachments. Change packaging to 'pom'." ) \ No newline at end of file diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java index 7e6536f1..66bf21f1 100644 --- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java @@ -229,6 +229,8 @@ void initProperties() throws MojoExecutionException { } } + @Override + @SuppressWarnings("MethodLength") public void execute() throws MojoExecutionException, MojoFailureException { if (Boolean.parseBoolean(skip) || ("releases".equals(skip) && !ArtifactUtils.isSnapshot(version)) diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java index 79ee1d87..2c586615 100644 --- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java +++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java @@ -180,6 +180,7 @@ private boolean hasState(MavenProject project) { return pluginContext.containsKey(DEPLOY_PROCESSED_MARKER); } + @Override public void execute() throws MojoExecutionException, MojoFailureException { State state; if (Boolean.parseBoolean(skip)