From 23cdae68978a5eff25293e43086a15a67a2a2ed3 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Wed, 14 Aug 2024 19:21:27 +0200 Subject: [PATCH 01/18] [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 02/18] [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) From 14cc4c305af2fc53571afc8ef127d7bb23155ce5 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 15 Aug 2024 13:40:47 +0200 Subject: [PATCH 03/18] [MDEPLOY-311] Consider packaging in deploy-file mojo (#71) The packaging was not really considered. Borrow UT from PR #42, thanks! Changes: * honor packaging to calculate classifier (optionally) and extension * add param "extension" to override Maven calculated extension explicitly * switch to SLF4J logging --- https://issues.apache.org/jira/browse/MDEPLOY-311 --- .../maven/plugins/deploy/DeployFileMojo.java | 47 ++++++++++++++----- .../plugins/deploy/DeployFileMojoTest.java | 35 ++++++++++++++ .../deploy-file-packaging/plugin-config.xml | 36 ++++++++++++++ .../target/deploy-test-file-1.0-SNAPSHOT.jar | 1 + 4 files changed, 107 insertions(+), 12 deletions(-) create mode 100644 src/test/resources/unit/deploy-file-packaging/plugin-config.xml create mode 100644 src/test/resources/unit/deploy-file-packaging/target/deploy-test-file-1.0-SNAPSHOT.jar 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 66bf21f1..0dfc8c36 100644 --- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java +++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java @@ -55,6 +55,8 @@ import org.eclipse.aether.deployment.DeploymentException; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.util.artifact.SubArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Installs the artifact in the remote repository. @@ -63,6 +65,7 @@ */ @Mojo(name = "deploy-file", requiresProject = false, threadSafe = true) public class DeployFileMojo extends AbstractDeployMojo { + private final Logger log = LoggerFactory.getLogger(getClass()); /** * GroupId of the artifact to be deployed. Retrieved from POM file if specified. */ @@ -90,6 +93,15 @@ public class DeployFileMojo extends AbstractDeployMojo { @Parameter(property = "packaging") private String packaging; + /** + * Extension of the artifact to be deployed. If set, will override plugin own logic to detect extension. If not set, + * as Maven expected, packaging determines the artifact extension. + * + * @since 3.1.3 + */ + @Parameter(property = "extension") + private String extension; + /** * Description passed to a generated POM file (in case of generatePom=true) */ @@ -196,7 +208,7 @@ void initProperties() throws MojoExecutionException { JarEntry entry = jarEntries.nextElement(); if (pomEntry.matcher(entry.getName()).matches()) { - getLog().debug("Using " + entry.getName() + " as pomFile"); + log.debug("Using {} as pomFile", entry.getName()); foundPom = true; String base = file.getName(); if (base.indexOf('.') > 0) { @@ -215,7 +227,7 @@ void initProperties() throws MojoExecutionException { } if (!foundPom) { - getLog().info("pom.xml not found in " + file.getName()); + log.info("pom.xml not found in {}", file.getName()); } } catch (IOException e) { // ignore, artifact not packaged by Maven @@ -235,7 +247,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { if (Boolean.parseBoolean(skip) || ("releases".equals(skip) && !ArtifactUtils.isSnapshot(version)) || ("snapshots".equals(skip) && ArtifactUtils.isSnapshot(version))) { - getLog().info("Skipping artifact deployment"); + log.info("Skipping artifact deployment"); return; } @@ -266,18 +278,29 @@ public void execute() throws MojoExecutionException, MojoFailureException { DeployRequest deployRequest = new DeployRequest(); deployRequest.setRepository(remoteRepository); - boolean isFilePom = classifier == null && "pom".equals(packaging); - if (!isFilePom) { + String mainArtifactExtension; + if (classifier == null && "pom".equals(packaging)) { + mainArtifactExtension = "pom"; + } else { ArtifactType artifactType = session.getRepositorySession().getArtifactTypeRegistry().get(packaging); - if (artifactType != null - && (classifier == null || classifier.isEmpty()) - && !StringUtils.isEmpty(artifactType.getClassifier())) { - classifier = artifactType.getClassifier(); + if (artifactType != null) { + if (StringUtils.isEmpty(classifier) && !StringUtils.isEmpty(artifactType.getClassifier())) { + classifier = artifactType.getClassifier(); + } + mainArtifactExtension = artifactType.getExtension(); + } else { + mainArtifactExtension = packaging; } } + if (extension != null && !Objects.equals(extension, mainArtifactExtension)) { + log.warn( + "Main artifact extension should be '{}' but was overridden to '{}'", + mainArtifactExtension, + extension); + } Artifact mainArtifact = new DefaultArtifact( - groupId, artifactId, classifier, isFilePom ? "pom" : getExtension(file), version) + groupId, artifactId, classifier, extension != null ? extension : mainArtifactExtension, version) .setFile(file); deployRequest.addArtifact(mainArtifact); @@ -293,10 +316,10 @@ public void execute() throws MojoExecutionException, MojoFailureException { deployRequest.addArtifact(new SubArtifact(mainArtifact, "", "pom", pomFile)); } else if (generatePom) { temporaryPom = generatePomFile(); - getLog().debug("Deploying generated POM"); + log.debug("Deploying generated POM"); deployRequest.addArtifact(new SubArtifact(mainArtifact, "", "pom", temporaryPom)); } else { - getLog().debug("Skipping deploying POM"); + log.debug("Skipping deploying POM"); } } diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java index b1083cb3..13748814 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java @@ -276,6 +276,41 @@ public void testDeployIfArtifactIsNotJar() throws Exception { assertTrue(file.exists()); } + public void testDeployFileIfPackagingIsSet() throws Exception { + File testPom = new File(getBasedir(), "target/test-classes/unit/deploy-file-packaging/plugin-config.xml"); + mojo = (DeployFileMojo) lookupMojo("deploy-file", testPom); + + openMocks = MockitoAnnotations.openMocks(this); + + assertNotNull(mojo); + + DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession(); + repositorySession.setLocalRepositoryManager( + new SimpleLocalRepositoryManagerFactory(new DefaultLocalPathComposer()) + .newInstance(repositorySession, new LocalRepository(LOCAL_REPO))); + when(session.getRepositorySession()).thenReturn(repositorySession); + + String packaging = (String) getVariableValueFromObject(mojo, "packaging"); + + String groupId = (String) getVariableValueFromObject(mojo, "groupId"); + + String artifactId = (String) getVariableValueFromObject(mojo, "artifactId"); + + String version = (String) getVariableValueFromObject(mojo, "version"); + + assertEquals("differentpackaging", packaging); + + mojo.execute(); + + File deployedArtifact = new File( + remoteRepo, + "deploy-file-packaging/" + groupId.replace('.', '/') + "/" + + artifactId + "/" + version + "/" + artifactId + "-" + + version + "." + packaging); + + assertTrue(deployedArtifact.exists()); + } + private void addFileToList(File file, List fileList) { if (!file.isDirectory()) { fileList.add(file.getName()); diff --git a/src/test/resources/unit/deploy-file-packaging/plugin-config.xml b/src/test/resources/unit/deploy-file-packaging/plugin-config.xml new file mode 100644 index 00000000..170cd1c9 --- /dev/null +++ b/src/test/resources/unit/deploy-file-packaging/plugin-config.xml @@ -0,0 +1,36 @@ + + + + + + + maven-deploy-plugin + + org.apache.maven.test + maven-deploy-file-test + 1.0 + differentpackaging + ${basedir}/src/test/resources/unit/deploy-file-packaging/target/deploy-test-file-1.0-SNAPSHOT.jar + deploy-test + file://${basedir}/target/remote-repo/deploy-file-packaging + true + + + + + \ No newline at end of file diff --git a/src/test/resources/unit/deploy-file-packaging/target/deploy-test-file-1.0-SNAPSHOT.jar b/src/test/resources/unit/deploy-file-packaging/target/deploy-test-file-1.0-SNAPSHOT.jar new file mode 100644 index 00000000..6f5f2f81 --- /dev/null +++ b/src/test/resources/unit/deploy-file-packaging/target/deploy-test-file-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +This is not an actual jar \ No newline at end of file From 07948ea5303d94486906dfe810a6e1e404407c6c Mon Sep 17 00:00:00 2001 From: Huang Xiao Date: Thu, 15 Aug 2024 20:17:05 +0800 Subject: [PATCH 04/18] [MDEPLOY-320] Simplify and unify message (#64) This plugin used old ctor for MojoExecutionException that uses "message", "long message" and "source". The source is fully unused in Maven Core, while long message just complicates things. Just unify message, use one "standard" exception message. --- https://issues.apache.org/jira/browse/MDEPLOY-320 --- .../maven/plugins/deploy/DeployMojo.java | 14 +++---- .../maven/plugins/deploy/DeployMojoTest.java | 37 +++++++++---------- 2 files changed, 23 insertions(+), 28 deletions(-) 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 2c586615..7cf7a7ef 100644 --- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java +++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java @@ -382,20 +382,16 @@ RemoteRepository getDeploymentRepository( + "\" instead."); repo = getRemoteRepository(id, url); } else { - throw new MojoExecutionException( - altDeploymentRepo, - "Invalid legacy syntax and layout for repository.", - "Invalid legacy syntax and layout for alternative repository. Use \"" + id + "::" + url - + "\" instead, and only default layout is supported."); + throw new MojoExecutionException("Invalid legacy syntax and layout for alternative repository: \"" + + altDeploymentRepo + "\". Use \"" + id + "::" + url + + "\" instead, and only default layout is supported."); } } else { matcher = ALT_REPO_SYNTAX_PATTERN.matcher(altDeploymentRepo); if (!matcher.matches()) { - throw new MojoExecutionException( - altDeploymentRepo, - "Invalid syntax for repository.", - "Invalid syntax for alternative repository. Use \"id::url\"."); + throw new MojoExecutionException("Invalid syntax for alternative repository: \"" + altDeploymentRepo + + "\". Use \"id::url\"."); } else { String id = matcher.group(1).trim(); String url = matcher.group(2).trim(); diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java index 52964cc5..ce128e4f 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java @@ -711,17 +711,18 @@ public void testLegacyAltDeploymentRepositoryWithLegacyLayout() throws Exception setVariableValueToObject(mojo, "project", project); setVariableValueToObject(mojo, "session", session); - setVariableValueToObject(mojo, "altDeploymentRepository", "altDeploymentRepository::legacy::http://localhost"); + String altDeploymentRepository = "altDeploymentRepository::legacy::http://localhost"; + setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository); project.setVersion("1.0-SNAPSHOT"); try { - mojo.getDeploymentRepository(project, null, null, "altDeploymentRepository::legacy::http://localhost"); + mojo.getDeploymentRepository(project, null, null, altDeploymentRepository); fail("Should throw: Invalid legacy syntax and layout for repository."); } catch (MojoExecutionException e) { - assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository."); assertEquals( - e.getLongMessage(), - "Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported."); + e.getMessage(), + "Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository + + "\". Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported."); } } @@ -730,19 +731,18 @@ public void testInsaneAltDeploymentRepository() throws Exception { setVariableValueToObject(mojo, "project", project); setVariableValueToObject(mojo, "session", session); - setVariableValueToObject( - mojo, "altDeploymentRepository", "altDeploymentRepository::hey::wow::foo::http://localhost"); + String altDeploymentRepository = "altDeploymentRepository::hey::wow::foo::http://localhost"; + setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository); project.setVersion("1.0-SNAPSHOT"); try { - mojo.getDeploymentRepository( - project, null, null, "altDeploymentRepository::hey::wow::foo::http://localhost"); + mojo.getDeploymentRepository(project, null, null, altDeploymentRepository); fail("Should throw: Invalid legacy syntax and layout for repository."); } catch (MojoExecutionException e) { - assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository."); assertEquals( - e.getLongMessage(), - "Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported."); + e.getMessage(), + "Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository + + "\". Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported."); } } @@ -766,19 +766,18 @@ public void testLegacyScmSvnAltDeploymentRepository() throws Exception { mojo = new DeployMojo(); setVariableValueToObject(mojo, "project", project); - setVariableValueToObject( - mojo, "altDeploymentRepository", "altDeploymentRepository::legacy::scm:svn:http://localhost"); + String altDeploymentRepository = "altDeploymentRepository::legacy::scm:svn:http://localhost"; + setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository); project.setVersion("1.0-SNAPSHOT"); try { - mojo.getDeploymentRepository( - project, null, null, "altDeploymentRepository::legacy::scm:svn:http://localhost"); + mojo.getDeploymentRepository(project, null, null, altDeploymentRepository); fail("Should throw: Invalid legacy syntax and layout for repository."); } catch (MojoExecutionException e) { - assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository."); assertEquals( - e.getLongMessage(), - "Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported."); + e.getMessage(), + "Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository + + "\". Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported."); } } From 00c14ad45c4414ed7efe8155e1e253b9a8624404 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 15 Aug 2024 14:22:24 +0200 Subject: [PATCH 05/18] Remove deprecation warning: update invoker properties --- src/it/gav-validation/invoker.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/it/gav-validation/invoker.properties b/src/it/gav-validation/invoker.properties index 6635374e..051dc7ed 100644 --- a/src/it/gav-validation/invoker.properties +++ b/src/it/gav-validation/invoker.properties @@ -18,5 +18,5 @@ invoker.goals = org.apache.maven.plugins:maven-deploy-plugin:${project.version}:deploy-file invoker.buildResult = failure -invoker.systemPropertiesFile.1 = test-invalid.properties -invoker.systemPropertiesFile.2 = test-missing.properties +invoker.userPropertiesFile.1 = test-invalid.properties +invoker.userPropertiesFile.2 = test-missing.properties From 96bc8644102ef83ec38b250590c9f069212179fe Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 15 Aug 2024 21:46:38 +0200 Subject: [PATCH 06/18] [maven-release-plugin] prepare release maven-deploy-plugin-3.1.3 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index dc0c27d8..f91315fe 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ under the License. maven-deploy-plugin - 3.1.3-SNAPSHOT + 3.1.3 maven-plugin Apache Maven Deploy Plugin @@ -49,7 +49,7 @@ under the License. scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git - HEAD + maven-deploy-plugin-3.1.3 https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag} @@ -88,7 +88,7 @@ under the License. ${version.maven-surefire} ${version.maven-war-plugin} - 2024-04-26T10:30:44Z + 2024-08-15T19:46:32Z From 424f2159ef09e4270e138a6f14ecd1aeb393caee Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 15 Aug 2024 21:46:50 +0200 Subject: [PATCH 07/18] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f91315fe..dc70856b 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ under the License. maven-deploy-plugin - 3.1.3 + 3.1.4-SNAPSHOT maven-plugin Apache Maven Deploy Plugin @@ -49,7 +49,7 @@ under the License. scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git - maven-deploy-plugin-3.1.3 + HEAD https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag} @@ -88,7 +88,7 @@ under the License. ${version.maven-surefire} ${version.maven-war-plugin} - 2024-08-15T19:46:32Z + 2024-08-15T19:46:50Z From 21739448e56b253f56f01ec1e18fa42a506bb49c Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Fri, 7 Feb 2025 19:45:29 +0100 Subject: [PATCH 08/18] Fix IT deploy-bom for Maven rc-2 --- src/it/deploy-bom/verify.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/src/it/deploy-bom/verify.groovy b/src/it/deploy-bom/verify.groovy index 2b314e99..89795885 100644 --- a/src/it/deploy-bom/verify.groovy +++ b/src/it/deploy-bom/verify.groovy @@ -18,7 +18,6 @@ */ def expectedDeploys = [ - 'org/apache/maven/its/deploy/bom/test/1.0/test-1.0-build.pom', 'org/apache/maven/its/deploy/bom/test/1.0/test-1.0.pom', 'org/apache/maven/its/deploy/bom/test/maven-metadata.xml', ] From 386fcf9ea2ba76129390b2c9317f7e8c7bee9138 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Fri, 7 Feb 2025 18:25:09 +0100 Subject: [PATCH 09/18] Release drafter configuration and PR Automation --- .github/workflows/pr-automation.yml | 29 +++++++++++++++++++++++++++ .github/workflows/release-drafter.yml | 7 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-automation.yml diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml new file mode 100644 index 00000000..e9d66988 --- /dev/null +++ b/.github/workflows/pr-automation.yml @@ -0,0 +1,29 @@ +# 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. + +name: PR Automation +on: + pull_request_target: + types: + - closed + - unlabeled + - review_requested + +jobs: + pr-automation: + name: PR Automation + uses: apache/maven-gh-actions-shared/.github/workflows/pr-automation.yml@v4 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 1049eaa3..77432128 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -19,7 +19,12 @@ name: Release Drafter on: push: branches: - - master + - maven-deploy-plugin-3.x + workflow_dispatch: + jobs: update_release_draft: uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4 + with: + config-name: 'release-drafter-3.x.yml' + From 66b357b3922dd9edf265a256073f438086acca34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 07:11:12 +0000 Subject: [PATCH 10/18] Bump mavenVersion from 3.9.6 to 3.9.9 Bumps `mavenVersion` from 3.9.6 to 3.9.9. Updates `org.apache.maven:maven-plugin-api` from 3.9.6 to 3.9.9 - [Release notes](https://github.com/apache/maven/releases) - [Commits](https://github.com/apache/maven/compare/maven-3.9.6...maven-3.9.9) Updates `org.apache.maven:maven-core` from 3.9.6 to 3.9.9 Updates `org.apache.maven:maven-model` from 3.9.6 to 3.9.9 Updates `org.apache.maven:maven-artifact` from 3.9.6 to 3.9.9 Updates `org.apache.maven:maven-compat` from 3.9.6 to 3.9.9 - [Release notes](https://github.com/apache/maven/releases) - [Commits](https://github.com/apache/maven/compare/maven-3.9.6...maven-3.9.9) Updates `org.apache.maven:maven-resolver-provider` from 3.9.6 to 3.9.9 --- updated-dependencies: - dependency-name: org.apache.maven:maven-plugin-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven:maven-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven:maven-model dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven:maven-artifact dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven:maven-compat dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.apache.maven:maven-resolver-provider dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc70856b..a277bd0a 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ under the License. 8 - 3.9.6 + 3.9.9 1.9.18 From 69b6824633ed0cd39184a3918e5cc6087039d9ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCnger?= Date: Wed, 12 Feb 2025 17:53:36 +0100 Subject: [PATCH 11/18] [MNGSITE-529] Rename "Goals" to "Plugin Documentation" --- src/site/site.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/site.xml b/src/site/site.xml index 6df80c46..d5800873 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -48,7 +48,7 @@ under the License. - + From 65c05b75dcb81a9dcc1a2a4dcc98fb84ad3f2dd3 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Tue, 18 Feb 2025 19:42:15 +0100 Subject: [PATCH 12/18] PR Automation only on close event --- .github/workflows/pr-automation.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml index e9d66988..53075957 100644 --- a/.github/workflows/pr-automation.yml +++ b/.github/workflows/pr-automation.yml @@ -20,8 +20,6 @@ on: pull_request_target: types: - closed - - unlabeled - - review_requested jobs: pr-automation: From 39f204ce4e093884036607149bcbd543bdb47627 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 07:11:41 +0000 Subject: [PATCH 13/18] Bump resolverVersion from 1.9.18 to 1.9.22 Bumps `resolverVersion` from 1.9.18 to 1.9.22. Updates `org.apache.maven.resolver:maven-resolver-api` from 1.9.18 to 1.9.22 - [Release notes](https://github.com/apache/maven-resolver/releases) - [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.18...maven-resolver-1.9.22) Updates `org.apache.maven.resolver:maven-resolver-util` from 1.9.18 to 1.9.22 - [Release notes](https://github.com/apache/maven-resolver/releases) - [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.18...maven-resolver-1.9.22) Updates `org.apache.maven.resolver:maven-resolver-connector-basic` from 1.9.18 to 1.9.22 - [Release notes](https://github.com/apache/maven-resolver/releases) - [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.18...maven-resolver-1.9.22) Updates `org.apache.maven.resolver:maven-resolver-transport-file` from 1.9.18 to 1.9.22 - [Release notes](https://github.com/apache/maven-resolver/releases) - [Commits](https://github.com/apache/maven-resolver/compare/maven-resolver-1.9.18...maven-resolver-1.9.22) Updates `org.apache.maven.resolver:maven-resolver-transport-http` from 1.9.18 to 1.9.22 --- updated-dependencies: - dependency-name: org.apache.maven.resolver:maven-resolver-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven.resolver:maven-resolver-util dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.maven.resolver:maven-resolver-connector-basic dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.apache.maven.resolver:maven-resolver-transport-file dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.apache.maven.resolver:maven-resolver-transport-http dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a277bd0a..d05ed9e6 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ under the License. 8 3.9.9 - 1.9.18 + 1.9.22 1.7.36 From 6dd30b3a63ffd542a2245cfc70b79a5156911465 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sat, 22 Feb 2025 18:27:29 +0100 Subject: [PATCH 14/18] Enable GitHub Issues --- README.md | 19 +------------------ pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 52b7b0fd..77abb0fa 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Contributing to [Apache Maven Deploy Plugin](https://maven.apache.org/plugins/maven-deploy-plugin/) ====================== -[![ASF Jira](https://img.shields.io/endpoint?url=https%3A%2F%2Fmaven.apache.org%2Fbadges%2Fasf_jira-MDEPLOY.json)][jira] [![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license] +[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-deploy-plugin.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-deploy-plugin) [![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-deploy-plugin.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.maven.plugins/maven-deploy-plugin) [![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/apache/maven/plugins/maven-deploy-plugin/README.md) [![Jenkins Status](https://img.shields.io/jenkins/s/https/ci-maven.apache.org/job/Maven/job/maven-box/job/maven-deploy-plugin/job/master.svg?)][build] @@ -34,7 +34,6 @@ things. Getting Started --------------- -+ Make sure you have a [JIRA account](https://issues.apache.org/jira/). + Make sure you have a [GitHub account](https://github.com/signup/free). + If you're planning to implement a new feature, it makes sense to discuss your changes on the [dev list][ml-list]] first. @@ -60,37 +59,21 @@ There are some guidelines which will make applying PRs easier for us: + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted, create a separate PR for this change. + Check for unnecessary whitespace with `git diff --check` before committing. -+ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue. -``` -[MDEPLOY-XXX] - Subject of the JIRA Ticket - Optional supplemental description. -``` + Make sure you have added the necessary tests (JUnit/IT) for your changes. + Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken. + Submit a pull request to the repository in the Apache organization. -+ Update your JIRA ticket and include a link to the pull request in the ticket. If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla]. -Making Trivial Changes ----------------------- - -For changes of a trivial nature to comments and documentation, it is not always -necessary to create a new ticket in JIRA. In this case, it is appropriate to -start the first line of a commit with '(doc)' instead of a ticket number. - Additional Resources -------------------- + [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch) -+ [Apache Maven Deploy JIRA project page][jira] + [Contributor License Agreement][cla] + [General GitHub documentation](https://help.github.com/) + [GitHub pull request documentation](https://help.github.com/send-pull-requests/) + [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject) -+ #Maven IRC channel on freenode.org -[jira]: https://issues.apache.org/jira/projects/MDEPLOY/ [license]: https://www.apache.org/licenses/LICENSE-2.0 [ml-list]: https://maven.apache.org/mailing-lists.html [code-style]: https://maven.apache.org/developers/conventions/code.html diff --git a/pom.xml b/pom.xml index d05ed9e6..cfefcb1b 100644 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,8 @@ under the License. https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag} - JIRA - https://issues.apache.org/jira/browse/MDEPLOY + GitHub + https://github.com/apache/maven-deploy-plugin/issues Jenkins From 538c67c9735ab203483f5700e0478c8bb5720eeb Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sun, 23 Feb 2025 18:23:52 +0100 Subject: [PATCH 15/18] [maven-release-plugin] prepare release maven-deploy-plugin-3.1.4 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index cfefcb1b..c95e8b31 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ under the License. maven-deploy-plugin - 3.1.4-SNAPSHOT + 3.1.4 maven-plugin Apache Maven Deploy Plugin @@ -49,7 +49,7 @@ under the License. scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git - HEAD + maven-deploy-plugin-3.1.4 https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag} @@ -88,7 +88,7 @@ under the License. ${version.maven-surefire} ${version.maven-war-plugin} - 2024-08-15T19:46:50Z + 2025-02-23T17:23:46Z From 504f9263be0a7fcc105470703c4e36aae63bbbd8 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sun, 23 Feb 2025 18:24:00 +0100 Subject: [PATCH 16/18] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c95e8b31..88dae01b 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ under the License. maven-deploy-plugin - 3.1.4 + 3.1.5-SNAPSHOT maven-plugin Apache Maven Deploy Plugin @@ -49,7 +49,7 @@ under the License. scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git scm:git:https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git - maven-deploy-plugin-3.1.4 + HEAD https://github.com/apache/maven-deploy-plugin/tree/${project.scm.tag} @@ -88,7 +88,7 @@ under the License. ${version.maven-surefire} ${version.maven-war-plugin} - 2025-02-23T17:23:46Z + 2025-02-23T17:24:00Z From 3c3b5df45e78b51939e6a21e00dc4a9ae3877156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BCnger?= Date: Wed, 9 Apr 2025 05:20:22 +0200 Subject: [PATCH 17/18] Update Plugins to 44 (3.x branch) --- pom.xml | 3 ++- .../org/apache/maven/plugins/deploy/DeployFileMojoTest.java | 2 +- .../apache/maven/plugins/deploy/DeployFileMojoUnitTest.java | 2 +- .../org/apache/maven/plugins/deploy/DeployMojoTest.java | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 88dae01b..38509981 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven.plugins maven-plugins - 43 + 44 @@ -149,6 +149,7 @@ under the License. org.apache.maven.plugin-tools maven-plugin-annotations + ${version.maven-plugin-tools} provided diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java index 13748814..bd5db2ec 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoTest.java @@ -40,7 +40,7 @@ * @author Allan Ramirez */ public class DeployFileMojoTest extends AbstractMojoTestCase { - private final String LOCAL_REPO = getBasedir() + "/target/local-repo"; + private static final String LOCAL_REPO = getBasedir() + "/target/local-repo"; private List expectedFiles; diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java index c368b365..2bd39c9a 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployFileMojoUnitTest.java @@ -58,7 +58,7 @@ public void tearDown() { static class MockDeployFileMojo extends DeployFileMojo { private Model model; - public MockDeployFileMojo(Model model) { + MockDeployFileMojo(Model model) { this.model = model; } diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java index ce128e4f..64517bf2 100644 --- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java @@ -57,9 +57,9 @@ public class DeployMojoTest extends AbstractMojoTestCase { private File localRepo; - private final String LOCAL_REPO = getBasedir() + "/target/local-repo"; + private static final String LOCAL_REPO = getBasedir() + "/target/local-repo"; - private final String REMOTE_REPO = getBasedir() + "/target/remote-repo"; + private static final String REMOTE_REPO = getBasedir() + "/target/remote-repo"; DeployArtifactStub artifact; @@ -628,7 +628,7 @@ public void testNonPomDeployWithAttachedArtifactsOnly() throws Exception { } @Ignore("SCP is not part of Maven3 distribution. Aether handles transport extensions.") - public void _testBasicDeployWithScpAsProtocol() throws Exception { + public void basicDeployWithScpAsProtocol() throws Exception { String originalUserHome = System.getProperty("user.home"); // FIX THE DAMN user.home BEFORE YOU DELETE IT!!! From 08ec3a0b593f3cbec361dd96441f80573f77ab06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 17:43:00 +0000 Subject: [PATCH 18/18] Bump org.apache.maven.plugins:maven-plugins from 44 to 45 Bumps [org.apache.maven.plugins:maven-plugins](https://github.com/apache/maven-parent) from 44 to 45. - [Release notes](https://github.com/apache/maven-parent/releases) - [Commits](https://github.com/apache/maven-parent/commits) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-plugins dependency-version: '45' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 38509981..34d3f135 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ under the License. org.apache.maven.plugins maven-plugins - 44 + 45