Maven build integration with Artifactory for dependency resolution and artifact deployment. Use when building Maven projects with Artifactory repositories. Triggers on jf mvn, Maven build, mvn install, Maven deploy, pom.xml.
Maven builds with Artifactory integration.
# Configure Maven
jf mvnc \
--repo-resolve-releases libs-release \
--repo-resolve-snapshots libs-snapshot \
--repo-deploy-releases libs-release-local \
--repo-deploy-snapshots libs-snapshot-local
# Build
jf mvn clean install
# Deploy
jf mvn deploy
jf mvn-config
jf mvnc
jf mvnc \
--repo-resolve-releases libs-release \
--repo-resolve-snapshots libs-snapshot \
--repo-deploy-releases libs-release-local \
--repo-deploy-snapshots libs-snapshot-local \
--server-id my-server
# Standard Maven goals
jf mvn clean install
jf mvn clean package
jf mvn clean deploy
# With Maven wrapper
jf mvn clean install --use-wrapper
# Skip tests
jf mvn clean install -DskipTests
# Custom settings
jf mvn -s settings.xml clean install
# With build info
jf mvn clean install \
--build-name=my-app \
--build-number=123
# Automatic from environment
export JFROG_CLI_BUILD_NAME=my-app
export JFROG_CLI_BUILD_NUMBER=$BUILD_NUMBER
jf mvn clean install
# Configure
jf mvnc \
--repo-resolve-releases libs-release \
--repo-resolve-snapshots libs-snapshot \
--repo-deploy-releases libs-release-local \
--repo-deploy-snapshots libs-snapshot-local
# Set build info
export JFROG_CLI_BUILD_NAME=my-app
export JFROG_CLI_BUILD_NUMBER=$BUILD_NUMBER
# Build with info collection
jf mvn clean deploy
# Collect environment and git
jf rt bce
jf rt bag
# Publish build info
jf rt bp
# Scan build
jf bs $JFROG_CLI_BUILD_NAME $JFROG_CLI_BUILD_NUMBER
# Build all modules
jf mvn clean install
# Build specific module
jf mvn clean install -pl my-module -am
# Activate profiles
jf mvn clean install -P production,security
Get dependency tree for scanning:
# Standard Maven
mvn dependency:tree
# With NuGet-style output for JFrog
jf rt nuget-deps-tree
# Check Artifactory connectivity
jf rt ping
# Verify repos exist
jf rt curl -XGET /api/repositories
# Check settings
cat ~/.m2/settings.xml
# Re-configure
jf mvnc --server-id my-server
# Verify server config
jf config show
# Ensure using jf mvn, not mvn directly
jf mvn clean install --build-name=my-app --build-number=1
# Verify build was published
jf rt curl -XGET "/api/build/my-app/1"