This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch maven-atr-plugin
in repository https://gitbox.apache.org/repos/asf/maven-studies.git


The following commit(s) were added to refs/heads/maven-atr-plugin by this push:
     new 3c2b22477 improve ATR terms used
3c2b22477 is described below

commit 3c2b224772ea97e784e971be41caf2b8c3398ab7
Author: HervĂ© Boutemy <[email protected]>
AuthorDate: Sun Mar 15 11:26:22 2026 +0100

    improve ATR terms used
---
 pom.xml                                            |  2 +-
 src/it/apache-release-profile/verify.groovy        |  1 +
 .../org/apache/maven/plugins/atr/UploadMojo.java   | 27 ++++++++--------------
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/pom.xml b/pom.xml
index dcbecd67e..c6bff06c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@ under the License.
   </parent>
 
   <artifactId>maven-atr-plugin</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
+  <version>1.0.0-beta-1-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Apache Maven ATR Plugin</name>
diff --git a/src/it/apache-release-profile/verify.groovy 
b/src/it/apache-release-profile/verify.groovy
index 152cae182..21e37f62b 100644
--- a/src/it/apache-release-profile/verify.groovy
+++ b/src/it/apache-release-profile/verify.groovy
@@ -22,6 +22,7 @@ def buildLog = new File(basedir, 'build.log')
 assert buildLog.exists()
 assert buildLog.text.contains('DRY RUN: Simulating ATR upload')
 assert buildLog.text.contains('DRY RUN: Would upload:')
+assert buildLog.text.contains('Composing release 
https://release-test.apache.org/compose/test-apache-release/1.0-SNAPSHOT')
 assert buildLog.text.contains('to 
https://release-test.apache.org/file/test-apache-release/1.0-SNAPSHOT/test-apache-release-1.0-SNAPSHOT-source-release.zip')
 
 return true
diff --git a/src/main/java/org/apache/maven/plugins/atr/UploadMojo.java 
b/src/main/java/org/apache/maven/plugins/atr/UploadMojo.java
index 7602632e7..20b212ca9 100644
--- a/src/main/java/org/apache/maven/plugins/atr/UploadMojo.java
+++ b/src/main/java/org/apache/maven/plugins/atr/UploadMojo.java
@@ -18,8 +18,6 @@
  */
 package org.apache.maven.plugins.atr;
 
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.nio.file.Path;
 
 import org.apache.maven.plugin.MojoExecutionException;
@@ -68,8 +66,7 @@ public class UploadMojo extends AbstractAtrMojo {
         } else {
             getLog().info("Uploading artifacts to ATR...");
         }
-        getLog().info("Project: " + project);
-        getLog().info("Version: " + version);
+        getLog().info("Composing release " + url + "compose/" + project + "/" 
+ version);
         if (directory != null) {
             getLog().info("Directory: " + directory);
         }
@@ -89,11 +86,11 @@ public class UploadMojo extends AbstractAtrMojo {
      */
     private void upload(Path file) throws MojoExecutionException, 
MojoFailureException {
         if (dryRun) {
-            getLog().info("DRY RUN: Would upload: " + file.getFileName() + " 
to " + getComposeUrl(file));
+            getLog().info("DRY RUN: Would upload: " + file.getFileName() + " 
to " + getAtrFileUrl(file));
             return;
         }
 
-        getLog().info("Uploading: " + file.getFileName() + " to " + 
getComposeUrl(file));
+        getLog().info("Uploading: " + file.getFileName() + " to " + 
getAtrFileUrl(file));
 
         // TODO: Implement ATR upload logic for single file
         // This will integrate with the ATR CLI (atr upload) functionality
@@ -101,14 +98,14 @@ public class UploadMojo extends AbstractAtrMojo {
     }
 
     /**
-     * Get the compose URL for a file by combining the base URL, project, 
version, directory, and filename.
+     * Get the ATR storage URL for a file.
      *
-     * @param file the file to get the compose URL for
-     * @return the compose URL
-     * @throws MojoExecutionException if the URL cannot be constructed
+     * @param file the file to get the ATR file URL for
+     * @return the file URL
      */
-    private URL getComposeUrl(Path file) throws MojoExecutionException {
-        StringBuilder path = new StringBuilder("file/")
+    private String getAtrFileUrl(Path file) {
+        StringBuilder path = new StringBuilder(url.toString())
+                .append("file/")
                 .append(project)
                 .append("/")
                 .append(version)
@@ -117,10 +114,6 @@ public class UploadMojo extends AbstractAtrMojo {
             path.append(directory).append("/");
         }
         path.append(file.getFileName().toString());
-        try {
-            return new URL(url, path.toString());
-        } catch (MalformedURLException e) {
-            throw new MojoExecutionException("Failed to construct compose URL 
for file: " + file, e);
-        }
+        return path.toString();
     }
 }

Reply via email to