diff --git a/application/pom.xml b/application/pom.xml index 1c3d2725e..3fa920c9b 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -29,10 +29,10 @@ io.quarkus quarkus-jdbc-postgresql - - - - + + io.quarkus + quarkus-smallrye-openapi + diff --git a/application/src/main/resources/META-INF/resources/index.html b/application/src/main/resources/META-INF/resources/index.html new file mode 100644 index 000000000..85bc9bd70 --- /dev/null +++ b/application/src/main/resources/META-INF/resources/index.html @@ -0,0 +1,244 @@ + + + + + dingrogu + + + +
+
+
+ + + + + quarkus_logo_horizontal_rgb_1280px_reverse + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+

Endpoints

+ Visit the Swagger UI + Version +
+
+
+ + diff --git a/application/src/main/resources/application.yaml b/application/src/main/resources/application.yaml index 00eb703d2..0c26939e6 100644 --- a/application/src/main/resources/application.yaml +++ b/application/src/main/resources/application.yaml @@ -2,6 +2,8 @@ quarkus: http: enable-compression: true enable-decompression: true + swagger-ui: + always-include: true websocket: dispatch-to-worker: true hibernate-orm: diff --git a/communication/src/main/java/org/jboss/da/communication/GalleyMavenProducer.java b/communication/src/main/java/org/jboss/da/communication/GalleyMavenProducer.java index 3bbe813a3..1cb620548 100644 --- a/communication/src/main/java/org/jboss/da/communication/GalleyMavenProducer.java +++ b/communication/src/main/java/org/jboss/da/communication/GalleyMavenProducer.java @@ -8,7 +8,6 @@ import org.commonjava.maven.galley.auth.MemoryPasswordManager; import org.commonjava.maven.galley.cache.partyline.PartyLineCacheProvider; import org.commonjava.maven.galley.config.TransportManagerConfig; -import org.commonjava.maven.galley.config.TransportMetricConfig; import org.commonjava.maven.galley.event.NoOpFileEventManager; import org.commonjava.maven.galley.filearc.FileTransportConfig; import org.commonjava.maven.galley.io.HashedLocationPathGenerator; @@ -20,7 +19,6 @@ import org.commonjava.maven.galley.maven.rel.ModelProcessorConfig; import org.commonjava.maven.galley.maven.spi.defaults.MavenPluginDefaults; import org.commonjava.maven.galley.maven.spi.defaults.MavenPluginImplications; -import org.commonjava.maven.galley.model.Location; import org.commonjava.maven.galley.nfc.MemoryNotFoundCache; import org.commonjava.maven.galley.proxy.NoOpProxySitesCache; import org.commonjava.maven.galley.spi.auth.PasswordManager; @@ -30,11 +28,8 @@ import org.commonjava.maven.galley.spi.proxy.ProxySitesCache; import org.commonjava.maven.galley.spi.transport.LocationExpander; import org.commonjava.maven.galley.transport.NoOpLocationExpander; -import org.commonjava.maven.galley.transport.htcli.Http; -import org.commonjava.maven.galley.transport.htcli.HttpImpl; import org.commonjava.maven.galley.transport.htcli.conf.GlobalHttpConfiguration; import org.commonjava.maven.galley.transport.htcli.conf.GlobalProxyConfig; -import org.commonjava.o11yphant.metrics.api.MetricRegistry; import org.commonjava.util.partyline.Partyline; import java.io.File; @@ -55,22 +50,6 @@ public class GalleyMavenProducer { private PathGenerator pathGenerator; - private final TransportMetricConfig transportMetricConfig = new TransportMetricConfig() { - public boolean isEnabled() { - return false; - } - - @Override - public String getNodePrefix() { - return null; - } - - @Override - public String getMetricUniqueName(Location location) { - return null; - } - }; - @PostConstruct void init() { try { @@ -128,11 +107,6 @@ public WeftConfig getWeftConfig() { return new DefaultWeftConfig(); } - @Produces - public Http getHttp() { - return new HttpImpl(getPasswordManager()); - } - @Produces public PasswordManager getPasswordManager() { return new MemoryPasswordManager(); @@ -158,11 +132,6 @@ public GlobalHttpConfiguration getGlobalHttpConfiguration() { return globalHttpConfiguration; } - @Produces - public TransportMetricConfig getTransportMetricConfig() { - return transportMetricConfig; - } - @Produces public ObjectMapper getObjectMapper() { return new ObjectMapper(); @@ -203,11 +172,6 @@ public ProxySitesCache getProxySitesCache() { return new NoOpProxySitesCache(); } - @Produces - public MetricRegistry getMetricRegistry() { - return null; - } - // Only appears to be used by GalleyWrapperTestIT @Produces public ModelProcessorConfig getModelProcessorConfig() { diff --git a/reports-rest/pom.xml b/reports-rest/pom.xml index f60b157f3..0bda7f194 100644 --- a/reports-rest/pom.xml +++ b/reports-rest/pom.xml @@ -32,10 +32,6 @@ io.quarkus quarkus-websockets - - io.quarkus - quarkus-smallrye-openapi - io.quarkus quarkus-hibernate-validator diff --git a/reports-rest/src/main/java/org/jboss/da/rest/ReportsRestActivator.java b/reports-rest/src/main/java/org/jboss/da/rest/ReportsRestActivator.java index 08dd7304e..883323d03 100644 --- a/reports-rest/src/main/java/org/jboss/da/rest/ReportsRestActivator.java +++ b/reports-rest/src/main/java/org/jboss/da/rest/ReportsRestActivator.java @@ -31,7 +31,7 @@ title = "Dependency Analyzer", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"), version = DA_VERSION), - servers = { @Server(url = "/da", description = "Dependency Analyzer") }, + servers = { @Server(url = "/", description = "Dependency Analyzer") }, tags = { @Tag(name = "lookup", description = "Lookup of artifact versions."), @Tag(name = "blocklist", description = "Listings of blocklisted artifacts"), @@ -39,25 +39,9 @@ @Tag(name = "deprecated", description = "Deprecated endpoints.") }) public class ReportsRestActivator extends Application { - // @Context - // private ServletConfig servletConfig; - - // @PostConstruct - // public void init() { - // configureSwagger(); - // } - - /* - * private void configureSwagger() { try { var builder = new JaxrsOpenApiContextBuilder().application(this) - * .resourcePackages(Collections.singleton("org.jboss.da.rest")); if (servletConfig != null) { - * builder.servletConfig(servletConfig); } builder.buildContext(true); } catch (OpenApiConfigurationException ex) { - * throw new IllegalArgumentException("Failed to setup OpenAPI configuration", ex); } } - */ - @Override public Set> getClasses() { Set> resources = new HashSet<>(); - // addSwaggerResources(resources); addProjectResources(resources); addMetricsResources(resources); addExceptionMappers(resources); @@ -65,17 +49,10 @@ public Set> getClasses() { return resources; } - /** - * Swagger classes required to generate the API JSON generation - * - * @param resources public void addSwaggerResources(Set> resources) { resources.add(OpenApiResource.class); - * } - */ - /** * Add all JAX-RS classes here to get activated! * - * @param resources + * @param resources Resource to be added */ public void addProjectResources(Set> resources) { resources.add(Root.class); diff --git a/reports-rest/src/main/java/org/jboss/da/rest/Root.java b/reports-rest/src/main/java/org/jboss/da/rest/Root.java index 644e4b09d..e904ce61b 100644 --- a/reports-rest/src/main/java/org/jboss/da/rest/Root.java +++ b/reports-rest/src/main/java/org/jboss/da/rest/Root.java @@ -25,7 +25,7 @@ public String getDescription() { + DA_VERSION + "" + "\n" + ""; } diff --git a/reports-rest/src/main/java/org/jboss/da/rest/SwaggerConfiguration.java b/reports-rest/src/main/java/org/jboss/da/rest/SwaggerConfiguration.java deleted file mode 100644 index 005d8b9e8..000000000 --- a/reports-rest/src/main/java/org/jboss/da/rest/SwaggerConfiguration.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.jboss.da.rest; - -/** - * @author Honza Brázdil <jbrazdil@redhat.com> - * - * @OpenAPIDefinition( info = @Info( title = "Dependency Analyzer", license = @License(name = "Apache 2.0", url - * = "https://www.apache.org/licenses/LICENSE-2.0.html"), version = DA_VERSION), servers = { @Server(url = - * "/da", description = "Dependency Analyzer") }, tags = { - * @Tag(name = "lookup", description = "Lookup of artifact versions."), - * @Tag(name = "blocklist", description = "Listings of blocklisted artifacts"), - * @Tag(name = "reports", description = "Get report of dependencies of projects"), - * @Tag(name = "deprecated", description = "Deprecated endpoints.") }) public interface SwaggerConfiguration { - * - * } - */ \ No newline at end of file diff --git a/testsuite/src/test/java/org/jboss/da/test/client/rest/RestApiIndexTestIT.java b/testsuite/src/test/java/org/jboss/da/test/client/rest/RestApiIndexTestIT.java index 4a823d05b..c974bd49d 100644 --- a/testsuite/src/test/java/org/jboss/da/test/client/rest/RestApiIndexTestIT.java +++ b/testsuite/src/test/java/org/jboss/da/test/client/rest/RestApiIndexTestIT.java @@ -29,7 +29,7 @@ private String getExpectedResponse() { + DA_VERSION + "" + "\n" + ""; }