Maven
Maven Pipelines
Build JAR artifacts and publish to JFrog Artifactory or Nexus, or run Maven via command-line script. Three supported workflow patterns
Prerequisites
Jenkins tool registered in Opsera Tool Registry
JFrog Artifactory Maven tool or NexusIQ tool registered (depending on workflow)
SCM repository with Maven project registered
Pipeline setup — Workflow 1: Maven → JFrog
Create Maven Build step
Tool = Jenkins. In Step Settings: Job Type = Opsera Managed Job, Job = Maven. Set SCM Account, Repository, Script File Path, Output File Path. Enable Output Variables if needed. Select Java version from Dependency dropdown.
Create JFrog Publish step
Tool = JFrog Artifactory Maven. Step Type = Push Artifacts, Repository Format = Maven. Set Group Name, Artifact Name. Link to the Maven build step via the Build Step dropdown. Optionally enable Use Run Count as Version.
Pipeline setup — Workflow 2: Maven → Nexus
Create Maven Build stepSame as Workflow 1, Step 1
Create Nexus Publish
stepTool = NexusIQ. Step Type = Push Artifacts, Repository Format = Maven. Set Repository, Group Name, Artifact Name. Link to the Maven build step. Optionally enable Use Run Count as Version.
Points to remember
Enable
Use Run Count as Versionin the publish step to auto-version artifacts based on pipeline execution count — useful for tracing builds back to exact pipeline runs.The Build Step dropdown in publish steps must reference a valid upstream Maven build step in the same pipeline — mismatches will cause artifact resolution failures.
For the command-line workflow, ensure your script includes
mvn clean installbefore packaging to avoid stale build artifacts from previous runs.
Last updated

