JFrog artifactory tutorial Download setup JAR deployment |Video upload date:  · Duration: PT6M33S  · Language: EN

Step by step guide to download set up JFrog Artifactory and deploy JAR files to a local repository for Java CI workflows

If you want a place to store your Java babies and stop emailing JARs to colleagues like it is 2003 this guide walks you through downloading, running and using JFrog Artifactory to host a local Maven repository. It covers installing with Docker or a service package, creating a repository, configuring Maven and actually pushing a JAR so your CI pipeline will stop crying.

Download Artifactory

You can grab the Artifactory distribution from the vendor site or use the official Docker image for a fast lab. Docker is the little black belt move here because it avoids system dependency drama and makes cleanup pleasant when you inevitably try a new idea that fails spectacularly.

Install and start Artifactory

For a quick local test run the Docker image. A minimal example looks like this.

docker pull jfrog/artifactory-oss:latest
docker run -d --name artifactory -p 8081:8081 jfrog/artifactory-oss:latest

If you installed the service package follow the installer prompts, start the service and open the web console at http://localhost:8081. Create an admin user and do the basic health check. No, the wizard will not judge your commit history.

Create a local Maven repository

In the web console create a new repository of type Maven local. Pick a sensible name like my-maven-local. Naming things is 90 percent of good DevOps so do not name it "repo1" unless you enjoy chaos.

Configure Maven to talk to Artifactory

Edit your ~/.m2/settings.xml to add server credentials for a dedicated deploy user. Then point your project POM distribution management to the new repo. Example snippets.

<settings>
  <servers>
    <server>
      <id>artifactory-repo</id>
      <username>deploy-user</username>
      <password>REPLACE_ME</password>
    </server>
  </servers>
</settings>
<distributionManagement>
  <repository>
    <id>artifactory-repo</id>
    <url>http://localhost:8081/artifactory/my-maven-local</url>
  </repository>
</distributionManagement>

Use a dedicated deploy user so your CI jobs do not run with admin permissions. That is how accidents become incidents.

Deploy a JAR

Two main options. For automated pipelines use the Maven deploy goal. For manual testing use the web UI upload.

  • Automated deploy from a project build agent run mvn clean deploy after making sure the POM distribution management id matches the server id in settings.xml.
  • Manual upload open the Artifactory UI, navigate to your repository and use the Deploy artifact button. It is delightfully low tech for emergency use.

Verify the deployed artifact

Check the UI to confirm the JAR and its metadata are present. If you prefer REST calls use the Artifactory storage API to inspect the item and verify checksums. Example with curl.

curl -u deploy-user:REPLACE_ME \
  "http://localhost:8081/artifactory/api/storage/my-maven-local/com/example/my-artifact/1.0/my-artifact-1.0.jar"

The response contains file info and checksums so you can script verification in CI or just flex your newfound power.

CI integration tips

  • Store credentials in your CI secret store and avoid putting passwords in plain text. This is not optional.
  • Use a non admin deploy user for pipeline jobs to reduce blast radius if a token leaks.
  • Consider using Artifactory as a proxy for Maven Central to improve build stability and performance.

Recap and final snark

We covered downloading and running Artifactory, creating a Maven local repository, updating Maven to use that repository and deploying a JAR either by Maven or manual upload. You now have a basic artifact management workflow suitable for local testing or small CI pipelines.

Pro tip use the Docker image for local labs because you will probably tear it down and rebuild it several times while pretending you knew what you were doing all along.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.