Skip to content

Commit

Permalink
Fix mvn release for versioned artifact
Browse files Browse the repository at this point in the history
The `mvn release:prepare` failed with
```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.1:shade (default) on project kryo5: Error creating shaded jar: /path/to/kryo/target/kryo-5.0.0-RC5.jar (No such file or directory)
```
because release:prepare invoked clean when building the versioned (kryo5) module.

To fix this, for the maven release plugin the `preparationGoals`
are overridden, to only invoke `verify` (default is `clean verify`).

When running a release, `clean` of course has to be run manually at first.
  • Loading branch information
magro committed Mar 8, 2020
1 parent 878c005 commit 78bc3dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<!-- Don't run clean, because this would delete the kryo artifact, which would fail the shade plugin
because the kryo jar would no longer exist.
https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#preparationGoals
-->
<preparationGoals>verify</preparationGoals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down

0 comments on commit 78bc3dc

Please sign in to comment.