Appearance
Get started
This document takes you from nothing to a deployed artifact that another build can resolve. It takes about ten minutes.
Before you begin
You need a CodeSoh account. To create one, see Create an account.
Create a repository
To create a repository, follow these steps:
- Go to artifex.soh.gg and sign in.
- Click Create repository.
- In the Name field, enter a name for people to read, such as
Libraries. - In the URL name field, enter the slug that appears in the repository's address, such as
libs. - Under Visibility, select Private or Public.
- Click Create repository.
The repository page shows its Maven URL:
https://artifex.soh.gg/maven/OWNER/libs/For every setting, see Repositories.
Create a token
Build tools authenticate with a personal access token, not with your password.
To create one, follow these steps:
- Go to accounts.soh.gg and open Personal access tokens.
- Click Create token.
- In the Name field, enter
CIor the name of the machine that uses it. - In the Product list, select Artifex.
- In the Expires list, select an expiry.
- Click Create token and copy the token. It's shown only once.
For more information, see Personal access tokens.
Grant the token access to the repository
A token reaches nothing until you grant it, even in your own repository.
To grant it, follow these steps:
- In Artifex, open the repository and go to Tokens.
- In the Token list, select the token that you created.
- Under Permission, select Write.
- Click Grant access.
For the rules that govern grants, see Tokens in Artifex.
Configure Maven
Put the credentials in ~/.m2/settings.xml:
xml
<settings>
<servers>
<server>
<id>codesoh</id>
<username>YOUR_HANDLE</username>
<password>cs_pat_YOUR_TOKEN</password>
</server>
</servers>
</settings>Point your project at the repository in pom.xml:
xml
<distributionManagement>
<repository>
<id>codesoh</id>
<url>https://artifex.soh.gg/maven/OWNER/libs/</url>
</repository>
<snapshotRepository>
<id>codesoh</id>
<url>https://artifex.soh.gg/maven/OWNER/libs/</url>
</snapshotRepository>
</distributionManagement>The id of the server and the id of the repository must match, because that's how Maven finds the credentials.
Configure Gradle
Put the credentials in ~/.gradle/gradle.properties:
properties
codesohUsername=YOUR_HANDLE
codesohPassword=cs_pat_YOUR_TOKENAdd the repository to build.gradle.kts:
kotlin
plugins {
`maven-publish`
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
repositories {
maven {
name = "codesoh"
url = uri("https://artifex.soh.gg/maven/OWNER/libs/")
credentials(PasswordCredentials::class)
}
}
}Gradle reads codesohUsername and codesohPassword because the repository is named codesoh.
Deploy
With Maven:
shell
mvn deployWith Gradle:
shell
./gradlew publishAllPublicationsToCodesohRepositoryArtifex verifies every checksum that the client uploads, records the files, and generates the repository's maven-metadata.xml. For what else happens, see Deploy artifacts.
Resolve
Add the repository to the build that consumes the artifact.
In pom.xml:
xml
<repositories>
<repository>
<id>codesoh</id>
<url>https://artifex.soh.gg/maven/OWNER/libs/</url>
</repository>
</repositories>In settings.gradle.kts:
kotlin
dependencyResolutionManagement {
repositories {
mavenCentral()
maven {
name = "codesoh"
url = uri("https://artifex.soh.gg/maven/OWNER/libs/")
credentials(PasswordCredentials::class)
}
}
}A public repository needs no credentials to read. For more information, see Resolve dependencies.
Where to go next
- To let the repository serve dependencies from Maven Central as well, see Upstream repositories.
- To share the repository with other people, see Share a repository.
- To see what you deployed, see Browse a repository.