--- /dev/null
+---
+- job-template:
+ name: lf-maven-central-macro-test
+
+ #####################
+ # Default variables #
+ #####################
+
+ mvn-central: true
+ ossrh-profile-id: ''
+
+ #####################
+ # Job configuration #
+ #####################
+
+ builders:
+ - lf-maven-central:
+ mvn-central: '{mvn-central}'
+ ossrh-profile-id: '{ossrh-profile-id}'
Workaround for Jenkins not able to find Java in JaCoCo runs.
+.. _lf-maven-central:
+
+lf-maven-central
+----------------
+
+Publish artifacts to OSSRH (Maven Central) staging.
+
+Requires that the project's settings.xml contains a ServerId 'ossrh' with the
+credentials for the project's OSSRH account.
+
+This macro assumes the directory ``$WORKSPACE/m2repo`` contains a Maven 2
+repository which is to upload to OSSRH.
+
+:Required parameters:
+
+ :mvn-central: Whether or not to upload to mvn-central. (true|false)
+ :ossrh-profile-id: Nexus staging profile ID as provided by OSSRH.
+
+.. literalinclude:: ../../.jjb-test/lf-macros/lf-maven-central-minimal.yaml
+ :language: yaml
+
+.. _lf-maven-install:
+
lf-maven-install
----------------
- ../shell/deploy-maven-file.sh
- lf-provide-maven-settings-cleanup
+- builder:
+ name: lf-maven-central
+ builders:
+ - conditional-step:
+ condition-kind: boolean-expression
+ condition-expression: '{mvn-central}'
+ steps:
+ - lf-infra-create-netrc:
+ server-id: 'ossrh'
+ - inject:
+ properties-content: 'OSSRH_PROFILE_ID={ossrh-profile-id}'
+ - shell: !include-raw-escape: ../shell/maven-central.sh
+
- builder:
name: lf-maven-install
builders:
sign-artifacts: '{sign-artifacts}'
sign-dir: '$WORKSPACE/m2repo'
- lf-maven-stage
- - conditional-step:
- condition-kind: boolean-expression
- condition-expression: '{mvn-central}'
- steps:
- - lf-infra-create-netrc:
- server-id: 'ossrh'
- - inject:
- properties-content: 'OSSRH_PROFILE_ID={ossrh-profile-id}'
- - shell: !include-raw-escape: ../shell/maven-central.sh
+ - lf-maven-central:
+ mvn-central: '{mvn-central}'
+ ossrh-profile-id: '{ossrh-profile-id}'
- lf-provide-maven-settings-cleanup
- job-template:
--- /dev/null
+---
+features:
+ - |
+ New macro **lf-maven-central** is available to deploy artifacts to OSSRH
+ staging for jobs that want to eventually deploy to Maven Central.
+
+ .. literalinclude:: ../.jjb-test/lf-macros/lf-maven-central-minimal.yaml
+ :language: yaml