Skip to content

Instantly share code, notes, and snippets.

@max-weis
Created May 26, 2020 09:56
Show Gist options
  • Save max-weis/ddee52c2723eacfd67a0cfecdc690cb1 to your computer and use it in GitHub Desktop.
Save max-weis/ddee52c2723eacfd67a0cfecdc690cb1 to your computer and use it in GitHub Desktop.
swagger wildfly config
<version.swagger>2.0.2</version.swagger>
<swagger-ui.version>3.17.0</swagger-ui.version>
---
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>swagger-ui</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>${swagger-ui.version}</version>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/swagger-ui</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources combine.children="append">
<resource>
<directory>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}
</directory>
<includes>
<include>**/*.*</include>
</includes>
<targetPath>swagger-ui</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/index.html
</file>
<replacements>
<replacement>
<token>http://petstore.swagger.io/v2/swagger.json</token>
<value>../api/openapi.json</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
---
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
<version>${version.swagger}</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
<version>${version.swagger}</version>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment