Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a plugin configuration defined in parent pom from child pom

I have a parent pom defining in pluginManagement some configuration items for a plugin in which there is a particular one config. that I do not want in child pom.

I tried overriding other configuration items in my child pom, which worked, but "removing" a configuration item didn't seem to work. By "removing" I mean I tried not filling in anything, e.g.:

<configuration>
  <itemIdontWant></itemIdontWant>
</configuration>

The above didn't work and I still got the same config. in the compilation process. I can fill in some garbage to void the effect of this item, but I want the proper way to "remove" it. Any help?

like image 509
user1589188 Avatar asked Dec 18 '22 23:12

user1589188


1 Answers

You can simply try the following:

<configuration>
  <itemIdontWant combine.self="override"></itemIdontWant>
</configuration>

The problem with the above could be that if you like to set it to empty the defaults of the plugin will become the value.

Furthermore you can change the inheritance of the configuration by using:

<build>
  <plugins>
    <plugin>
      <inherited>false</inherited>
      <groupId>...</groupId>
      <artifactId>..</artifactId>
    </plugin>
  </plugins>
</build>

The documentation of the above parts can be found here: https://maven.apache.org/pom.html

like image 147
khmarbaise Avatar answered Dec 28 '22 12:12

khmarbaise