Adding version properties and swagger profile to parent pom
diff --git a/pom.xml b/pom.xml
index cf5011b..4815075 100644
--- a/pom.xml
+++ b/pom.xml
@@ -117,6 +117,7 @@
<javax.activation.version>1.1.1</javax.activation.version>
<javax.servlet.version>4.0.1</javax.servlet.version>
<javax.jaxrs.version>2.0</javax.jaxrs.version>
+ <javax.validation.version>2.0.1.Final</javax.validation.version>
<xmlunit.version>2.6.3</xmlunit.version>
@@ -132,6 +133,11 @@
<plexusUtilsPluginsVersion>3.0.15</plexusUtilsPluginsVersion>
+ <swagger.plugin.version>2.1.2</swagger.plugin.version>
+ <swagger.codegen.plugin.version>3.0.20</swagger.codegen.plugin.version>
+ <io.swagger.version>2.1.2</io.swagger.version>
+
+
<enunciate.docsDir/>
<enunciate.version>2.12.0</enunciate.version>
<enunciate.debug>false</enunciate.debug>
@@ -1007,50 +1013,125 @@
</build>
</profile>
+ <!-- Swagger Profile for REST Service modules -->
<profile>
- <id>enunciate</id>
+ <id>swagger</id>
<activation>
<file>
- <exists>${basedir}/src/enunciate/enunciate.xml</exists>
+ <exists>${basedir}/src/main/resources/openapi-configuration.yaml</exists>
</file>
</activation>
+ <dependencies>
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-jaxrs2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ </dependencies>
+
<build>
- <plugins>
- <plugin>
- <groupId>com.webcohesion.enunciate</groupId>
- <artifactId>enunciate-maven-plugin</artifactId>
- <version>${enunciate.version}</version>
- <executions>
- <execution>
- <id>generate-enunciate-docs</id>
- <goals>
- <goal>docs</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <docsDir>${enunciate.docsDir}</docsDir>
- <configFile>src/enunciate/enunciate.xml</configFile>
- <sourcepath-includes>
- <include>
- <groupId>org.apache.archiva</groupId>
- </include>
- <include>
- <groupId>org.apache.archiva.maven</groupId>
- </include>
- </sourcepath-includes>
- </configuration>
- <dependencies>
- <!-- needed for jdk 11 -->
- <!--dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.3.0</version>
- </dependency-->
- </dependencies>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>bind-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>${swagger.plugin.version}</version>
+ <configuration>
+ <outputFileName>openapi</outputFileName>
+ <outputPath>${project.build.directory}/generated</outputPath>
+ <outputFormat>JSONANDYAML</outputFormat>
+ <prettyPrint>TRUE</prettyPrint>
+ <configurationFilePath>${project.basedir}/src/main/resources/openapi-configuration.yaml</configurationFilePath>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>resolve</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>io.swagger.codegen.v3</groupId>
+ <artifactId>swagger-codegen-maven-plugin</artifactId>
+ <version>${swagger.codegen.plugin.version}</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <inputSpec>${project.build.directory}/generated/openapi.yaml</inputSpec>
+ <language>html</language>
+ <output>${project.build.directory}/generated-sources</output>
+ <ignoreFileOverride>${project.basedir}/src/main/resources/openapi-codegen-ignore
+ </ignoreFileOverride>
+ <templateDirectory>${project.basedir}/src/main/resources/templates</templateDirectory>
+ <supportingFilesToGenerate>index.html</supportingFilesToGenerate>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>site</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/site/openapi/</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/generated</directory> <!-- source directory -->
+ <filtering>false</filtering>
+ <include>openapi.json</include>
+ <include>openapi.yaml</include>
+ </resource>
+ <resource>
+ <directory>${project.build.directory}/generated-sources/</directory>
+ <filtering>false</filtering>
+ <include>**/*</include>
+ <exclude>.swagger-codegen/**</exclude>
+ <exclude>.swagger-codegen-ignore</exclude>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
</build>
</profile>