Issue
I have a plugin in my Spring Boot projects pom.xml
which I would like the option of sometimes disabling when running mvn clean install
.
Is there a configuration I could add to my pom.xml
which would create a custom flag e.g. exc
, which when invoked like so mvn clean install -D exc
would build the jar, without that plugin.
For clarity, here is the plugin I would like to disable via a maven flag:
<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>${springdoc-openapi-maven.version}</version>
<configuration>
<apiDocsUrl>http://localhost:XXXX/v3/api-docs</apiDocsUrl>
<outputDir>${project.basedir}/openapi</outputDir>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
Solution
You can add <springdoc.skip>true</springdoc.skip>
to your <properties>
section.
Then you can activate the plugin by mvn clean install -Dspringdoc.skip=false
Answered By - J Fabian Meier