Skip to contentSkip to content

Deploy artifacts ​

Deploying uploads your build's publication files to a repository. Artifex accepts what mvn deploy and Gradle's maven-publish plugin send.

To deploy, you need the Write or Admin repository role. A build tool authenticates with a personal access token that has Write token access to that repository.

Configure Maven ​

Put the credentials in ~/.m2/settings.xml. The password is the token. The username can be any value, so use your username.

xml
<settings>
  <servers>
    <server>
      <id>artifex</id>
      <username>YOUR_USERNAME</username>
      <password>cs_pat_YOUR_TOKEN</password>
    </server>
  </servers>
</settings>

In pom.xml, configure distributionManagement with the same id so that Maven finds the credentials:

xml
<distributionManagement>
  <repository>
    <id>artifex</id>
    <url>https://artifex.soh.gg/maven/OWNER/REPOSITORY_NAME/</url>
  </repository>
  <snapshotRepository>
    <id>artifex</id>
    <url>https://artifex.soh.gg/maven/OWNER/REPOSITORY_NAME/</url>
  </snapshotRepository>
</distributionManagement>

Replace the following:

  • OWNER: the username of the repository owner
  • REPOSITORY_NAME: the repository name

Deploy the publication:

shell
mvn deploy

Configure Gradle ​

Put the credentials in ~/.gradle/gradle.properties. Gradle reads the two properties whose names start with the repository name:

properties
artifexUsername=YOUR_USERNAME
artifexPassword=cs_pat_YOUR_TOKEN

In the Kotlin DSL:

kotlin
plugins {
    `maven-publish`
}

publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])
        }
    }
    repositories {
        maven {
            name = "artifex"
            url = uri("https://artifex.soh.gg/maven/OWNER/REPOSITORY_NAME/")
            credentials(PasswordCredentials::class)
        }
    }
}

In the Groovy DSL:

groovy
plugins {
    id 'maven-publish'
}

publishing {
    publications {
        maven(MavenPublication) {
            from components.java
        }
    }
    repositories {
        maven {
            name = 'artifex'
            url = 'https://artifex.soh.gg/maven/OWNER/REPOSITORY_NAME/'
            credentials(PasswordCredentials)
        }
    }
}

Publish the publication:

shell
./gradlew publishAllPublicationsToArtifexRepository

What happens during a deployment ​

Artifex accepts each file that your build uploads, records who deployed it, and reads what it can from the file: Maven coordinates and dependencies from a POM, variants from Gradle Module Metadata (.module), and entries from a JAR file. The version appears in the repository, in Maven metadata, and in activity immediately.

Artifex verifies uploaded checksums against the files. If a file was corrupted in transit, the deployment fails with a message that identifies the checksum mismatch, and Artifex doesn't store the file.

Redeploy over an existing file ​

By default, an existing release file can't be redeployed. To allow redeployment, turn on Allow replacing files. For more information, see Immutability.

Limits ​

A single file can be at most 100 MB. For every limit, see Limits.

Advanced ​

A deployment is a series of PUT requests, one for each file. Artifex checks that the path follows the Maven repository layout and that the version in the filename matches its directory. Artifex then responds 201 Created, or 200 OK when the file replaced an existing file.

A checksum file such as hello-1.0.0.jar.sha1 is verified against the file that it describes. A mismatch responds 400 Bad Request with the value that Artifex computed. Upload the file before its checksum. A checksum for a file that isn't in the repository responds 404 Not Found. Artifex serves every checksum algorithm for every file whether or not your client uploaded one. For more information, see Checksums and signatures.

Artifex generates maven-metadata.xml documents from the files that it stores instead of storing the documents that Maven uploads. Therefore, Maven metadata can't disagree with the repository's files. Artifex refuses uploaded snapshot metadata that names a timestamped snapshot other than the newest deployed one with 400 Bad Request. For more information, see Snapshots.

Artifex refuses an upload larger than 100 MB with 413 Payload Too Large.