Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Dswagger.skip=false doesn't trigger plugin #888

Open
lorencole opened this issue Feb 23, 2023 · 1 comment
Open

-Dswagger.skip=false doesn't trigger plugin #888

lorencole opened this issue Feb 23, 2023 · 1 comment

Comments

@lorencole
Copy link

lorencole commented Feb 23, 2023

We'd like to only build our API spec in specific cases and have the plugin skipped by default. So in pom.xml we've got:

<plugin>
				<groupId>com.github.kongchen</groupId>
				<artifactId>swagger-maven-plugin</artifactId>
				<version>3.1.8</version>
				<configuration>
					<skipSwaggerGeneration>true</skipSwaggerGeneration>
					<apiSources> ...

This skips spec generation by default, but $ mvn compile -Dswagger.skip=false also skips generation. Using 3.1.8.

@lorencole lorencole changed the title -Dswagger.skip=false doesn't plugin -Dswagger.skip=false doesn't trigger plugin Feb 23, 2023
@marcogrcr
Copy link

marcogrcr commented Mar 28, 2024

Hi @lorencole, that's because the default value of <skipSwaggerGeneration> is:

<skipSwaggerGeneration>${swagger.skip}</skipSwaggerGeneration>

By using <skipSwaggerGeneration>true</skipSwaggerGeneration>, you "hardcode" true and remove the usage of of the swagger.skip property. To solve your problem, remove <skipSwaggerGeneration> and add the following to your pom.xml:

<properties>
  <!-- (...) -->
  <swagger.skip>true</swagger.skip>
</properties>

This way the swagger.skip property will default to true, but you can override it to false by specifying the system property via -Dswagger.skip=false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants