update swagger, guava and commons-io

This commit is contained in:
Michele Artini 2021-07-12 12:40:10 +02:00
parent f95382ece9
commit 2d6452f3c0
10 changed files with 32 additions and 42 deletions

View File

@ -8,6 +8,6 @@ public class ApiDocController {
@GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" }) @GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" })
public String apiDoc() { public String apiDoc() {
return "redirect:swagger-ui.html"; return "redirect:swagger-ui/";
} }
} }

View File

@ -27,7 +27,7 @@
<a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">Tools <span class="caret"></span></a> <a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">Tools <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="{{t.url}}" target="_blank" ng-repeat="t in tools">{{t.name}}</a> <a class="dropdown-item" href="{{t.url}}" target="_blank" ng-repeat="t in tools">{{t.name}}</a>
<a class="dropdown-item" href="/swagger-ui.html" target="_blank">API documentation</a> <a class="dropdown-item" href="/swagger-ui/" target="_blank">API documentation</a>
</div> </div>
</li> </li>
</ul> </ul>

View File

@ -8,6 +8,6 @@ public class ApiDocController {
@GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" }) @GetMapping({ "/apidoc", "/api-doc", "/doc", "/swagger" })
public String apiDoc() { public String apiDoc() {
return "redirect:swagger-ui.html"; return "redirect:swagger-ui/";
} }
} }

View File

@ -11,6 +11,6 @@ public class SwaggerController {
"/apidoc", "/api-doc", "/doc", "/swagger" "/apidoc", "/api-doc", "/doc", "/swagger"
}, method = RequestMethod.GET) }, method = RequestMethod.GET)
public String apiDoc() { public String apiDoc() {
return "redirect:swagger-ui.html"; return "redirect:swagger-ui/";
} }
} }

View File

@ -20,7 +20,7 @@
<h1>Metadata Store Manager</h1> <h1>Metadata Store Manager</h1>
<hr /> <hr />
<a href="./swagger-ui.html" target="_blank">API documentation</a> <a href="./swagger-ui/" target="_blank">API documentation</a>
<hr /> <hr />
<a href="javascript:void(0)" data-toggle="modal" data-target="#newMdstoreModal">create a new mdstore</a> <a href="javascript:void(0)" data-toggle="modal" data-target="#newMdstoreModal">create a new mdstore</a>
<hr /> <hr />

View File

@ -50,7 +50,7 @@ public class HomeController extends AbstractDnetController {
"/doc", "/swagger" "/doc", "/swagger"
}) })
public String apiDoc() { public String apiDoc() {
return "redirect:swagger-ui.html"; return "redirect:swagger-ui/";
} }
} }

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
@ -41,12 +43,7 @@
<!-- Swagger --> <!-- Swagger -->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency> </dependency>
<!-- for /metrics and /health controllers --> <!-- for /metrics and /health controllers -->

View File

@ -2,6 +2,7 @@ package eu.dnetlib.common.app;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.Arrays;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
@ -14,8 +15,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
import com.google.common.collect.Lists;
import io.micrometer.core.instrument.ImmutableTag; import io.micrometer.core.instrument.ImmutableTag;
import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Metrics;
import springfox.documentation.spi.DocumentationType; import springfox.documentation.spi.DocumentationType;
@ -40,7 +39,7 @@ public abstract class AbstractDnetApp {
final ImmutableTag tag2 = new ImmutableTag("version", model.getVersion()); final ImmutableTag tag2 = new ImmutableTag("version", model.getVersion());
final ImmutableTag tag3 = new ImmutableTag("scmtag", model.getScm().getTag()); final ImmutableTag tag3 = new ImmutableTag("scmtag", model.getScm().getTag());
Metrics.gauge("micrometer_info", Lists.newArrayList(tag1, tag2, tag3), 1); Metrics.gauge("micrometer_info", Arrays.asList(tag1, tag2, tag3), 1);
} catch (IOException | XmlPullParserException e) { } catch (IOException | XmlPullParserException e) {
log.error("Error registering metric", e); log.error("Error registering metric", e);
} }

View File

@ -67,13 +67,7 @@
<!-- Swagger --> <!-- Swagger -->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-boot-starter</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

32
pom.xml
View File

@ -1,4 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -101,7 +103,11 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.10</version> </dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency> </dependency>
<dependency> <dependency>
@ -136,6 +142,11 @@
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
</dependency>
<dependency> <dependency>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
@ -155,11 +166,6 @@
<version>1.4</version> <version>1.4</version>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
@ -169,7 +175,7 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.4</version> <version>2.10.0</version>
</dependency> </dependency>
<dependency> <dependency>
@ -219,14 +225,8 @@
<!-- Swagger --> <!-- Swagger -->
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-boot-starter</artifactId>
<version>2.9.2</version> <version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency> </dependency>
<!-- Hadoop --> <!-- Hadoop -->