How can I enable the swagger ui on a jhipster app in prod profile?

In the latest release add ths code to application.prod.yml

profiles:
  include: 
    -swagger

The Swagger configuration is in config/apidoc/SwaggerConfiguration.java

You could simply remove the line that excludes the prod profile:

@Profile("!"+Constants.SPRING_PROFILE_PRODUCTION)

In JHipster version 4.5.6, with Maven, you can enable swagger profiles directly:

./mvnw -Pprod,swagger

With Gradle, you can also use those profiles directly:

./gradlew -Pprod -Pswagger

Please note that by default, the swagger profile is disabled in prod and enabled in dev by setting the spring.profiles.include property in application.yml.

For more information, refer jhipster profiles