Wildfly 27 (Jakarta EE 10) swagger-maven-plugin

672 views
Skip to first unread message

D E

unread,
Dec 27, 2022, 12:24:41 PM12/27/22
to WildFly
We have been using...

        <plugin>
          <groupId>io.openapitools.swagger</groupId>
          <artifactId>swagger-maven-plugin</artifactId>
          <version>2.1.6</version>
        </plugin>

...to generate from configuration and source code annotations and publish to our maven repo: swagger.json/swagger.yaml.

However this is not compatible with the new jakarta namespace.

Is there a best practice out there for generating from source code annotations and publishing that supports Wildfly 27 / Jakarta EE 10?

Here is an example of what we do now:

      <plugin>
        <groupId>io.openapitools.swagger</groupId>
        <artifactId>swagger-maven-plugin</artifactId>
        <configuration>
          <resourcePackages>
            <resourcePackage>com.foo.bar.rest.api</resourcePackage>
          </resourcePackages>
          <outputDirectory>${basedir}/target/</outputDirectory>
          <outputFilename>swagger</outputFilename>
          <outputFormats>JSON,YAML</outputFormats>
          <prettyPrint>true</prettyPrint>
          <attachSwaggerArtifact>true</attachSwaggerArtifact>
          <swaggerConfig>
            <servers>
              <server>
                <url>https://foo.example.com/sso-app-rest/api</url>
                <description>Production SSO</description>
              </server>
              <server>
                <url>https://foo.example.com/tls-app-rest/api</url>
                <description>Production TLS</description>
              </server>
              <server>
                <url>https://bar.example.com/abcd-myapp-pri/tls-app-rest/api</url>
                <description>Production AppApi</description>
              </server>
              <server>
                <url>https://standby-foo.example.com/sso-app-rest/api</url>
                <description>Standby SSO</description>
              </server>
              <server>
                <url>https://standby-foo.example.com/tls-app-rest/api</url>
                <description>Standby TLS</description>
              </server>
              <server>
                <url>https://bar.example.com/abcd-myapp-alt/tls-app-rest/api</url>
                <description>Standby AppApi</description>
              </server>
              <server>
                <url>https://ple-foo.example.com/sso-app-rest/api</url>
                <description>PLE SSO</description>
              </server>
              <server>
                <url>https://ple-foo.example.com/tls-app-rest/api</url>
                <description>PLE TLS</description>
              </server>
              <server>
                <url>https://xy-stg.example.com/abcd-myapp-pri/tls-app-rest/api</url>
                <description>PLE AppApi</description>
              </server>
              <server>
                <url>https://e2e-impact.bar.example.com/sso-app-rest/api</url>
                <description>E2E SSO</description>
              </server>
              <server>
                <url>https://e2e-impact.bar.example.com/tls-app-rest/api</url>
                <description>E2E TLS</description>
              </server>
              <server>
                <url>https://xy-dev2.bar.example.com/abcd-myapp-e2e/tls-app-rest/api</url>
                <description>E2E AppApi</description>
              </server>
              <server>
                <url>https://xy0-foo.example.com/sso-app-rest/api</url>
                <description>XY0 SSO</description>
              </server>
              <server>
                <url>https://xy0-foo.example.com/tls-app-rest/api</url>
                <description>XY0 TLS</description>
              </server>
              <server>
                <url>https://xy-stg.example.com/abcd-myapp-alt/tls-app-rest/api</url>
                <description>XY0 AppApi</description>
              </server>
              <server>
                <url>https://xy1-foo.example.com/sso-app-rest/api</url>
                <description>XY1 SSO</description>
              </server>
              <server>
                <url>https://xy1-foo.example.com/tls-app-rest/api</url>
                <description>XY1 TLS</description>
              </server>
              <server>
                <url>https://xy-dev2.bar.example.com/abcd-myapp-pri/tls-app-rest/api</url>
                <description>XY1 AppApi</description>
              </server>
              <server>
                <url>https://xy2-foo.example.com/sso-app-rest/api</url>
                <description>XY2 SSO</description>
              </server>
              <server>
                <url>https://xy2-foo.example.com/tls-app-rest/api</url>
                <description>XY2 TLS</description>
              </server>
              <server>
                <url>https://xy-uat.bar.example.com/abcd-myapp-pri/tls-app-rest/api</url>
                <description>XY2 AppApi</description>
              </server>
              <server>
                <url>https://xy3-foo.example.com/sso-app-rest/api</url>
                <description>XY3 SSO</description>
              </server>
              <server>
                <url>https://xy3-foo.example.com/tls-app-rest/api</url>
                <description>XY3 TLS</description>
              </server>
              <server>
                <url>https://xy-uat.bar.example.com/abcd-myapp-alt/tls-app-rest/api</url>
                <description>XY3 AppApi</description>
              </server>
              <server>
                <url>https://xy4-foo.example.com/sso-app-rest/api</url>
                <description>XY4 SSO</description>
              </server>
              <server>
                <url>https://xy4-foo.example.com/tls-app-rest/api</url>
                <description>XY4 TLS</description>
              </server>
              <server>
                <url>https://xy-dev2.bar.example.com/abcd-myapp-alt/tls-app-rest/api</url>
                <description>XY4 AppApi</description>
              </server>
            </servers>
            <info>
              <title>APP ReST API</title>
              <version>${project.version}</version>
            </info>
          </swaggerConfig>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>


Emmanuel Hugonnet

unread,
Jan 2, 2023, 4:13:39 AM1/2/23
to D E, WildFly
Hello,
From the Swagger documentation:
"Since version 2.1.7, Swagger Core also supports the Jakarta namespace. There are a parallel set of artifacts with the |-jakarta| suffix,
providing the same functionality as the unsuffixed (i.e.: |javax|) artifacts. Please see the Wiki
<https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Getting-started> for more details."

Thus upgrading to 2.17 or better should do the trick.
Emmanel
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/7d5a1620-1629-426b-a709-8c54e9e65884n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/7d5a1620-1629-426b-a709-8c54e9e65884n%40googlegroups.com?utm_medium=email&utm_source=footer>.

D E

unread,
Jan 3, 2023, 7:53:12 AM1/3/23
to WildFly
That doc references the following (which has entirely different configuration syntax):

  <groupId>io.swagger.core.v3</groupId>

I was using:

  <groupId>io.openapitools.swagger</groupId>

However, re-working my configuration and switching plugins worked for me, thanks!

Subijay Bhattacharya

unread,
Sep 5, 2023, 5:28:15 AM9/5/23
to WildFly
Hi D E,

When you say "re-working my configuration and switching plugins worked for me", would you mind telling me what configurations you changed and which plugin you used?
Were you using Swagger 2 or OpenAPI 3?
I am having similar issue now.
I searched and found  io.openapitools.swagger:swagger-maven-plugin is probably End of Life (https://github.com/openapi-tools/swagger-maven-plugin/issues/106)
Reply all
Reply to author
Forward
0 new messages