Skip to content

First Steps

You need a CloudRepo account. If you have none, sign up first.

Used on this page only, never saved. Never enter a token or password here.

1. Create a repository. In the admin portal, click Repositories, then Create Repository. Choose Maven, keep Hosted, type a Name, and click Create repository.

2. Create a token. Click Repository Tokens, then Create token (Create your first token if you have none). Type a Name, choose Download and publish packages, tick your repository, and click Create token. Click Copy: CloudRepo shows the token once.

3. Put the token in your shell. Run this, paste the token, and press Enter. The shell shows nothing.

Terminalkeep the token out of files
read -rs CLOUDREPO_TOKEN && export CLOUDREPO_TOKEN

4. Publish a sample. Save your credential in ~/.m2/settings.xml. Maven reads the token from CLOUDREPO_TOKEN. Put your own email address in place of you@example.com. Your username is the email address of the account that created the token.

~/.m2/settings.xmlyour credential
<settings>
<servers>
<server>
<id>cloudrepo</id>
<username>you@example.com</username>
<password>${env.CLOUDREPO_TOKEN}</password>
</server>
</servers>
</settings>

In an empty directory, save this pom.xml. Put your own group and name in place of com.example and my-library if you like, and use the same ones in step 5.

pom.xmldeploy to CloudRepo
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-library</artifactId>
<version>1.0.0</version>
<distributionManagement>
<repository>
<id>cloudrepo</id>
<url>https://your-org.mycloudrepo.io/repositories/your-repo</url>
</repository>
</distributionManagement>
</project>
Terminaldeploy
mvn --batch-mode deploy

Expected: Uploaded to cloudrepo: for the POM and the JAR, then BUILD SUCCESS.

5. Install it from a second project. In another empty directory, save this pom.xml:

pom.xmlpull from CloudRepo
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-app</artifactId>
<version>1.0.0</version>
<repositories>
<repository>
<id>cloudrepo</id>
<url>https://your-org.mycloudrepo.io/repositories/your-repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>my-library</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

Build it with a local repository of its own, so Maven downloads my-library from CloudRepo instead of using the copy mvn deploy left on this machine:

Terminalinstall from CloudRepo
mvn --batch-mode -Dmaven.repo.local=local-repo package

Expected: Downloaded from cloudrepo: for my-library-1.0.0.jar, then BUILD SUCCESS.

For CI, use an organization token instead of your own token. It belongs to your organization, not to a person: see Service Keys for Your Pipelines.

You published a package and installed it from a second project. Next, move your repositories from Nexus or Artifactory or add your teammates.

The first time you sign in as the owner, the portal opens Create your first repository. It does steps 1 and 2 above for you:

  • In Create Repository, choose your format, type a Name, and click Create repository.
  • In Create Token, click Create token. The token can read and write that repository, and it expires in 90 days. The portal may ask you to confirm it is you first.
  • Configure Client shows the token once. Click Copy, then go on with step 3 above.
Create your first repository, with the four steps in one row above it (Create Repository, Create Token, Configure Client, Test Setup), a line for people leaving Nexus or Artifactory, and the form: Maven under Format, Hosted under Kind, an example name in the Name box, and its address under the box.

To leave the guided setup, click Skip setup and go to Overview.

View as Markdown