Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven deploy plugin override error?

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?

like image 940
Usman Ismail Avatar asked Oct 20 '25 03:10

Usman Ismail


1 Answers

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>
like image 117
Hombre Avatar answered Oct 25 '25 12:10

Hombre