The steps shown below explain how to use TeamCity's Artifactory plugin to run a basic Maven build. At last, the build content deployed together with the build info to the Artifactory instance as follows(TeamCity Professional 2022.10.2 was used for this article):
- Download the Artifactory plugin
- Via the TeamCity UI navigate to Administration → Plugins List → Upload Plugin Zip, and choose the zip-file download from your file- system. You will need to restart TeamCity (Tomcat) for the plugin to take effect.
- Navigate to Administration → Integrations → Artifactory → ‘Edit’ → and specify your Artifactory server URL (for example http://repo.jfrog.org/artifactory), and the Default deployer Username & Password, which are the login credentials of a user with deploy permissions in your Artifactroy instance. Then, save it after testing the connection.
- Navigate to your build screen → click on ‘Build Step’:
5. Click on ‘Add Build step’ and select ‘Maven’:
6. Then, specify the step name, the goals, and the path to the POM file where the desired project is located on your device. Please verify that the pom.xml file is configured properly.
7. Scroll down to the ‘Artifactory Integration’ section, enter the values in the relevant fields, and save. As an example:
8. Before running the build verify that you set up the desired device/server to work with your Artifactory instance by navigating in the UI to the ‘Application’ tab → ‘Artifactory’ → ‘Artifacts’ → click on virtual maven repository (in the screenshot below - ‘teamcity-libs-release’) → type your password, then generate → download the snippet attached (which contains your credentials) and place it in one of the locations described according to your use case:
9. Eventually, run the build, and you should see the following output, where the artifacts are placed in the correct location as configured in the pom.xml file:
TeamCity:
*The steps described above tested with our maven project-example .