Step 3: Add Maven Repositories and Artifacts

Get Started with the JFrog Platform

Content Type
Administration / Platform
ft:sourceType
Paligo

This step walks you through creating a Maven/Gradle repository type and uploading your project, allowing you to use Artifactory as your artifact repository. You can then follow the instructions to create other types of repositories, such as npm, Docker, and Go.

  1. Navigate to the Administration Module.

  2. Expand the Repositories menu and click the Repositories menu item.

  3. Create three new Maven/Gradle package type repositories.

    1. Add a new Local Repository with the Repository Key “maven-challenge-local” or “gradle-challenge-local” and keep the rest of the default settings.

    2. Click on the Remote tab and add a new Remote Repository with the Repository Key “maven-challenge-remote” or “gradle-challenge-remote” and keep the rest of the default settings.

    3. Click on the Virtual tab and add a new Virtual Repository with the Repository Key “maven-challenge” or “gradle-challenge”.

      1. Add the local and remote Maven/Gradle repositories you just created.

  4. Configure JFrog CLI, a smart client that provides a simple interface that automates access to JFrog products simplifying our automation scripts.

    1. Configure the Artifactory server.

      $ jf c add
  5. Take the following steps to build the project with Maven/Gradle and resolve the project dependencies from Artifactory.

    1. Move to the root project directory (cd Maven_Challenge or Gradle_Challenge directory)

    2. Configure the project's repositories.

      $ jf mvn-config

      or

      $ jf gradle-config
    3. Build the project with resolve the project dependencies from Artifactory.

      $ jf mvn clean install -f path/to/pom-file --build-name maven-challenge --build-number 1.0.0

      or

      $ jf gradle clean artifactoryPublish -b path/to/build.gradle  --build-name gradle-challenge --build-number 1.0.0
    4. Publish the build info to Artifactory.

      $ jf rt bp maven-challenge 1.0.0

      or

      $ jf rt bp gradle-challenge 1.0.0
  6. Navigate to the Application Module.

  7. Expand the Artifactory menu and click the Artifacts menu item.

  8. Navigate to the Application Module, in the Platform UI, expand the Artifactory menu and click the Artifacts menu item.

Here you’ll be able to see the details of your new artifacts.

Maven artifact.png
Gradle artifact.png