Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling site generation and deploy in maven

I have an existing maven project in which site goal is executed to generate and upload site to repository location. I need to disable only this site generation and deployment part from my maven release. How can I achieve that with minimal changes in my pom. In the pom, we are using maven-site-plugin version 3.4 and don't have any overrides defined (i.e. everything is default inherited for this plugin).

like image 568
V_Singh Avatar asked Jan 07 '23 21:01

V_Singh


1 Answers

I was able to find the solution for my problem. You can always override configurations for the plugins in your project POM file, which can override the configuration derived from parent POM file. You can use following user properties to disable site generation and site deployment:

  • maven.site.skip=true (skips generating site)
  • maven.site.deploy.skip=true (skips site deployment)

I inserted following in my pom and it worked fine:

<plugin>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
        <skip>true</skip>
        <skipDeploy>true</skipDeploy>
    </configuration>
</plugin>

You can see in the effective POM that these overrides were merged with the plugin configuration derived from parent pom.

like image 174
V_Singh Avatar answered Jan 15 '23 13:01

V_Singh