Skip to content

Commit

Permalink
GH-384 Exclude kotlin.reflect from shading
Browse files Browse the repository at this point in the history
  • Loading branch information
dzikoysk committed Feb 26, 2021
1 parent 5771c46 commit c6aaf35
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
24 changes: 23 additions & 1 deletion reposilite-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@
<groupId>io.javalin</groupId>
<artifactId>javalin-openapi</artifactId>
<version>3.13.3</version>
<exclusions>
<exclusion>
<artifactId>redoc</artifactId>
<groupId>org.webjars.npm</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down Expand Up @@ -165,7 +175,7 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.11.0</version>
<version>2.12.1</version>
</dependency>

<!-- Logging -->
Expand Down Expand Up @@ -284,6 +294,18 @@
<include>**</include>
</includes>
</filter>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>org.jetbrains.kotlin:kotlin-reflect</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void handle(Context context) throws Exception {
}

context.result(resource.getInputStream())
.contentType(FilesUtils.getMimeType(resource.getFile().getAbsolutePath(), "text/plain"))
.contentType(FilesUtils.getMimeType(context.path(), "text/plain"))
.res.setCharacterEncoding("UTF-8");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ public static boolean isReadable(String name) {
}

public static String getMimeType(String path, String defaultType) {
try {
return java.nio.file.Files.probeContentType(new File(path).toPath());
} catch (IOException exception) {
return MimeTypes.getMimeType(getExtension(path), defaultType);
}
return MimeTypes.getMimeType(getExtension(path), defaultType);
}

public static void copyResource(String resourcePath, File destination) throws IOException {
Expand Down

0 comments on commit c6aaf35

Please sign in to comment.