Skip to content

[JENKINS-72414] When using withMaven, "mvn deploy" no longer uploads artifacts to Nexus. #1304

@jenkins-infra-bot

Description

@jenkins-infra-bot

When using withMaven within my pipeline's constructs, the deploy plugin no longer tries to upload artifacts to Nexus. If I remove (comment out) the withMaven block, everything goes back to normal and deployment works.

However, I obviously lose all the publishers I'm interested in (JUnit, JaCoCo, etc.). I'm using withMaven() { ... }  (i.e. default mode, no special options or constructs).

In particular, I very strongly desire to not store actual build artifacts in Jenkins since they're already meant to be housed in Nexus (i.e. why double-store?).

I need Maven to be the "agent" performing the upload to Nexus since the target repository may change "dynamically" depending on certain criteria (i.e. a Maven profile that gets activated based on envvars and such) and special circumstances (we're working to remove this, but for now it's a requirement).

The deploy plugin in use is 3.1.1, but also fails with 2.7.


Originally reported by drivera, imported from: When using withMaven, "mvn deploy" no longer uploads artifacts to Nexus.
  • assignee: bguerin
  • status: Open
  • priority: Critical
  • component(s): pipeline-maven-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 4
  • imported: 20251211-223321
Raw content of original issue

When using withMaven within my pipeline's constructs, the deploy plugin no longer tries to upload artifacts to Nexus. If I remove (comment out) the withMaven block, everything goes back to normal and deployment works.

However, I obviously lose all the publishers I'm interested in (JUnit, JaCoCo, etc.). I'm using withMaven() { ... }  (i.e. default mode, no special options or constructs).

In particular, I very strongly desire to not store actual build artifacts in Jenkins since they're already meant to be housed in Nexus (i.e. why double-store?).

I need Maven to be the "agent" performing the upload to Nexus since the target repository may change "dynamically" depending on certain criteria (i.e. a Maven profile that gets activated based on envvars and such) and special circumstances (we're working to remove this, but for now it's a requirement).

The deploy plugin in use is 3.1.1, but also fails with 2.7.

environment
Jenkins: 2.426.1<br/>
OS: Linux - 4.18.0-372.19.1.el8_6.x86_64<br/>
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)<br/>
---<br/>
active-directory:2.34<br/>
ansible:285.v2f044b_eb_7a_3e<br/>
ansible-tower:0.16.0<br/>
ansicolor:1.0.4<br/>
ant:497.v94e7d9fffa_b_9<br/>
antisamy-markup-formatter:162.v0e6ec0fcfcf6<br/>
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757<br/>
apache-httpcomponents-client-5-api:5.2.3-1.0<br/>
authentication-tokens:1.53.v1c90fd9191a_b_<br/>
aws-credentials:218.v1b_e9466ec5da_<br/>
aws-global-configuration:128.ve2c5685a_09c3<br/>
aws-java-sdk-ec2:1.12.586-413.v6a_6c3a_420126<br/>
aws-java-sdk-minimal:1.12.586-413.v6a_6c3a_420126<br/>
blueocean:1.27.9<br/>
blueocean-bitbucket-pipeline:1.27.9<br/>
blueocean-commons:1.27.9<br/>
blueocean-config:1.27.9<br/>
blueocean-core-js:1.27.9<br/>
blueocean-dashboard:1.27.9<br/>
blueocean-display-url:2.4.2<br/>
blueocean-events:1.27.9<br/>
blueocean-git-pipeline:1.27.9<br/>
blueocean-github-pipeline:1.27.9<br/>
blueocean-i18n:1.27.9<br/>
blueocean-jwt:1.27.9<br/>
blueocean-personalization:1.27.9<br/>
blueocean-pipeline-api-impl:1.27.9<br/>
blueocean-pipeline-editor:1.27.9<br/>
blueocean-pipeline-scm-api:1.27.9<br/>
blueocean-rest:1.27.9<br/>
blueocean-rest-impl:1.27.9<br/>
blueocean-web:1.27.9<br/>
bootstrap5-api:5.3.2-2<br/>
bouncycastle-api:2.29<br/>
branch-api:2.1135.v8de8e7899051<br/>
build-everything-strategy:1.0-SNAPSHOT (private-2e232de0-diego)<br/>
build-timeout:1.31<br/>
caffeine-api:3.1.8-133.v17b_1ff2e0599<br/>
checks-api:2.0.2<br/>
cloud-stats:320.v96b_65297a_4b_b_<br/>
cloudbees-bitbucket-branch-source:856.v04c46c86f911<br/>
cloudbees-folder:6.858.v898218f3609d<br/>
code-coverage-api:4.99.0<br/>
command-launcher:107.v773860566e2e<br/>
commons-lang3-api:3.13.0-62.v7d18e55f51e2<br/>
commons-text-api:1.11.0-94.v3e1f4a_926e49<br/>
config-file-provider:959.vcff671a_4518b_<br/>
configuration-as-code:1746.vf1673cfe690a<br/>
configuration-as-code-groovy:1.1<br/>
coordinator:1.5.0<br/>
copyartifact:722.v0662a_9b_e22a_c<br/>
coverage:1.6.0<br/>
credentials:1309.v8835d63eb_d8a_<br/>
credentials-binding:642.v737c34dea_6c2<br/>
custom-folder-icon:2.10<br/>
data-tables-api:1.13.8-1<br/>
depbuilder:1.1.0<br/>
display-url-api:2.200.vb_9327d658781<br/>
docker-commons:439.va_3cb_0a_6a_fb_29<br/>
docker-java-api:3.3.4-86.v39b_a_5ede342c<br/>
docker-plugin:1.5<br/>
docker-workflow:572.v950f58993843<br/>
durable-task:523.va_a_22cf15d5e0<br/>
echarts-api:5.4.3-1<br/>
email-ext:2.102<br/>
envinject:2.908.v66a_774b_31d93<br/>
envinject-api:1.199.v3ce31253ed13<br/>
extensible-choice-parameter:1.8.1<br/>
favorite:2.4.3<br/>
file-operations:177.vd1773063d935<br/>
file-parameters:316.va_83a_1221db_a_7<br/>
folder-properties:1.2.1<br/>
font-awesome-api:6.4.2-1<br/>
forensics-api:2.3.0<br/>
generic-webhook-trigger:1.88.2<br/>
git:5.2.1<br/>
git-client:4.6.0<br/>
github:1.37.3.1<br/>
github-api:1.318-461.v7a_c09c9fa_d63<br/>
github-branch-source:1752.vc201a_0235d80<br/>
github-checks:554.vb_ee03a_000f65<br/>
github-pullrequest:0.5.0<br/>
gitlab-api:5.3.0-91.v1f9a_fda_d654f<br/>
gitlab-branch-source:684.vea_fa_7c1e2fe3<br/>
gitlab-plugin:1.7.16<br/>
gradle:2.9<br/>
h2-api:11.1.4.199-12.v9f4244395f7a_<br/>
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953<br/>
hidden-parameter:202.vb_964799875d7<br/>
htmlpublisher:1.32<br/>
instance-identity:185.v303dc7c645f9<br/>
ionicons-api:56.v1b_1c8c49374e<br/>
jackson2-api:2.15.3-372.v309620682326<br/>
jacoco:3.3.5<br/>
jakarta-activation-api:2.0.1-3<br/>
jakarta-mail-api:2.0.1-3<br/>
javadoc:243.vb_b_503b_b_45537<br/>
javax-activation-api:1.2.0-6<br/>
javax-mail-api:1.6.2-9<br/>
jaxb:2.3.9-1<br/>
jdk-tool:73.vddf737284550<br/>
jenkins-design-language:1.27.9<br/>
jersey2-api:2.41-133.va_03323b_a_1396<br/>
jjwt-api:0.11.5-77.v646c772fddb_0<br/>
job-fan-in:1.1.4<br/>
jquery3-api:3.7.1-1<br/>
jsch:0.2.8-65.v052c39de79b_2<br/>
junit:1240.vf9529b_881428<br/>
kubernetes:4147.va_d406fb_66172<br/>
kubernetes-client-api:6.8.1-224.vd388fca_4db_3b_<br/>
kubernetes-credentials:0.11<br/>
ldap:711.vb_d1a_491714dc<br/>
mailer:463.vedf8358e006b_<br/>
matrix-auth:3.2.1<br/>
matrix-project:818.v7eb_e657db_924<br/>
maven-artifact-choicelistprovider:1.17<br/>
metrics:4.2.18-442.v02e107157925<br/>
mina-sshd-api-common:2.11.0-86.v836f585d47fa_<br/>
mina-sshd-api-core:2.11.0-86.v836f585d47fa_<br/>
minio:1.3.3-rc93.9e92f846d4cf<br/>
nodejs:1.6.1<br/>
okhttp-api:4.11.0-157.v6852a_a_fa_ec11<br/>
pam-auth:1.10<br/>
parameterized-scheduler:255.v73827fcdf618<br/>
pipeline-build-step:516.v8ee60a_81c5b_9<br/>
pipeline-config-history:1.6<br/>
pipeline-github-lib:42.v0739460cda_c4<br/>
pipeline-graph-analysis:202.va_d268e64deb_3<br/>
pipeline-groovy-lib:689.veec561a_dee13<br/>
pipeline-input-step:477.v339683a_8d55e<br/>
pipeline-maven:1362.vee39a_d4b_02b_1<br/>
pipeline-maven-api:1362.vee39a_d4b_02b_1<br/>
pipeline-milestone-step:111.v449306f708b_7<br/>
pipeline-model-api:2.2151.ve32c9d209a_3f<br/>
pipeline-model-definition:2.2151.ve32c9d209a_3f<br/>
pipeline-model-extensions:2.2151.ve32c9d209a_3f<br/>
pipeline-rest-api:2.34<br/>
pipeline-stage-step:305.ve96d0205c1c6<br/>
pipeline-stage-tags-metadata:2.2151.ve32c9d209a_3f<br/>
pipeline-stage-view:2.34<br/>
pipeline-utility-steps:2.16.0<br/>
plain-credentials:143.v1b_df8b_d3b_e48<br/>
plugin-util-api:3.6.0<br/>
prism-api:1.29.0-9<br/>
pubsub-light:1.18<br/>
purge-job-history:1.6<br/>
remote-file:1.24<br/>
resource-disposer:0.23<br/>
role-strategy:689.v731678c3e0eb_<br/>
scm-api:683.vb_16722fb_b_80b_<br/>
script-security:1294.v99333c047434<br/>
snakeyaml-api:2.2-111.vc6598e30cc65<br/>
sonar:2.16.1<br/>
splunk-devops:1.10.1<br/>
splunk-devops-extend:1.10.1<br/>
sse-gateway:1.26<br/>
ssh-credentials:308.ve4497b_ccd8f4<br/>
ssh-slaves:2.916.vd17b_43357ce4<br/>
ssh-steps:2.0.68.va_d21a_12a_6476<br/>
sshd:3.312.v1c601b_c83b_0e<br/>
structs:325.vcb_307d2a_2782<br/>
text-file-operations:1.3.2<br/>
timestamper:1.26<br/>
token-macro:384.vf35b_f26814ec<br/>
trilead-api:2.84.v72119de229b_7<br/>
uno-choice:2.8.1<br/>
variant:60.v7290fc0eb_b_cd<br/>
veracode-scan:23.7.22.0<br/>
workflow-aggregator:596.v8c21c963d92d<br/>
workflow-api:1283.v99c10937efcb_<br/>
workflow-basic-steps:1042.ve7b_140c4a_e0c<br/>
workflow-cps:3812.vc3031a_b_a_c955<br/>
workflow-durable-task-step:1289.v4d3e7b_01546b_<br/>
workflow-job:1360.vc6700e3136f5<br/>
workflow-multibranch:756.v891d88f2cd46<br/>
workflow-scm-step:415.v434365564324<br/>
workflow-step-api:639.v6eca_cd8c04a_a_<br/>
workflow-support:865.v43e78cc44e0d<br/>
ws-cleanup:0.45

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions