Maven

Maven Pipelines

Build JAR artifacts and publish to JFrog Artifactory or Nexus, or run Maven via command-line script. Three supported workflow patterns

circle-info

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

1

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.

2

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

1

Create Maven Build stepSame as Workflow 1, Step 1

2

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.

circle-info

Points to remember

  • EnableUse 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 includesmvn clean installbefore packaging to avoid stale build artifacts from previous runs.

Last updated