You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Maven发布时配置maven-deploy-plugin失效问题求助

Troubleshooting Maven Deploy Skip Not Working with Release Plugin

Hey there! I totally get being a Maven newbie—let's break down why your skip configuration isn't kicking in when you run mvn clean release:prepare release:perform.

The Root Cause

The Maven Release Plugin runs release:perform in a forked, separate Maven build process. This means it checks out your tagged project version into a temporary directory and runs the deploy step there. The maven-deploy-plugin config you added directly to your main pom.xml won't automatically carry over to this forked build, which is why you still see skip = false in the logs.

Fixes to Try

1. Pass the Skip Flag Directly via Command Line

This is the quickest way to override the deploy behavior. Just add the system property to your command:

mvn clean release:prepare release:perform -Dmaven.deploy.skip=true

Command-line properties take priority over pom configurations and will be passed to the forked release build.

2. Configure the Maven Release Plugin to Pass the Skip Parameter

If you want this setting to be persistent (so you don't have to type the flag every time), update your pom.xml to configure the maven-release-plugin to pass the skip argument to the forked build:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-release-plugin</artifactId>
  <!-- Use the version you're actually using; check your build logs if unsure -->
  <version>2.5.3</version>
  <configuration>
    <arguments>-Dmaven.deploy.skip=true</arguments>
  </configuration>
</plugin>

This tells the release plugin to include that system property every time it runs the forked deploy build.

3. Bonus: Verify Your Tag's POM (If Needed)

If you already committed your maven-deploy-plugin config to your repo before running release:prepare, double-check that the tagged version of your pom.xml actually includes the <skip>true</skip> setting. Sometimes the release plugin might make minor adjustments to the pom during release:prepare, so it's worth confirming the tag has your changes.

Give these methods a shot—they should get that deploy step skipped like you want!

内容的提问来源于stack exchange,提问作者Tomas Marik

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 10:22:30