Usage

Configuring Credentials

The ATR Maven Plugin uses Maven's standard authentication mechanism. Configure your ATR credentials in ~/.m2/settings.xml:

<settings>
  <servers>
    <server>
      <id>apache.atr</id>
      <username>your-asf-id</username>
      <password>your-personal-access-token (encrypted)</password>
    </server>
  </servers>
</settings>

The username should be your ASF user ID and the password should be your Personal Access Token (PAT) from the ATR service.

For security, you should encrypt your password using Maven's password encryption.

Basic Upload

To upload release artifacts to ATR:

mvn org.apache.tooling:atr-maven-plugin:upload \
  -Datr.files=target/apache-maven-4.0.0-src.tar.gz,target/apache-maven-4.0.0-src.tar.gz.sha512

Integration ATR plugin with the push-to-atr profile

The typical use case is to integrate the ATR plugin into a push-to-atr profile that will be used optionally with apache-release profile:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.tooling</groupId>
        <artifactId>atr-maven-plugin</artifactId>
        <version>1.0.0-alpha-1-SNAPSHOT</version>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>push-to-atr</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.tooling</groupId>
            <artifactId>atr-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>atr-check-composing</id>
                <goals>
                  <goal>check-composing</goal>
                </goals>
              </execution>
              <execution>
                <id>upload-to-atr</id>
                <goals>
                  <goal>upload</goal>
                </goals>
                <configuration>
                  <files>
                    <file>${project.build.directory}/${project.artifactId}-${project.version}-source-release.zip</file>
                    <file>${project.build.directory}/${project.artifactId}-${project.version}-source-release.zip.sha512</file>
                    <file>${project.build.directory}/${project.artifactId}-${project.version}-source-release.zip.asc</file>
                  </files>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

Then you can test the upload current project version by running:

mvn clean deploy -Papache-release,push-to-atr

or during the release process:

mvn release:prepare
mvn release:perform -Ppush-to-atr

NOTE: The check-composing goal will check if the version is already being composed in ATR.

You need to manually create a new version in ATR service before using the push-to-atr profile.

Directory Organization

You can organize uploaded files in subdirectories:

<configuration>
  <directory>binaries</directory>
  <files>
    <file>${project.build.directory}/${project.artifactId}-${project.version}-bin.tar.gz</file>
  </files>
</configuration>

This will upload the file to the compose space at: binaries/.