I am trying to override deploy plugin for maven and get the following error on some of my projects but not others:
Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy failed: Cannot add two different pieces of metadata for:
Here is my plugin definition:
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<pomFile>target/modified-pom-replacePomPlaceholder/modified-pom/pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
Also tried this to same effect:
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<pomFile>target/modified-pom-replacePomPlaceholder/modified-pom/pom.xml</pomFile>
</configuration>
</plugin>
Any idea why it fails sometimes?
Don't override 'default-deploy'. Deactivate it and write your own:
<execution>
<id>default-deploy</id>
<phase>none</phase>
</execution>
<execution>
<id>my-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
...
</execution>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With