Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c19f7e69
Commit
c19f7e69
authored
Jan 04, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
See gh-24597
parent
4b5b97ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
JarTypeFilter.java
...in/java/org/springframework/boot/maven/JarTypeFilter.java
+10
-6
No files found.
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/JarTypeFilter.java
View file @
c19f7e69
/*
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -20,7 +20,6 @@ import java.io.IOException;
...
@@ -20,7 +20,6 @@ import java.io.IOException;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.jar.JarFile
;
import
java.util.jar.JarFile
;
import
java.util.jar.Manifest
;
import
java.util.jar.Manifest
;
...
@@ -45,13 +44,18 @@ class JarTypeFilter extends DependencyFilter {
...
@@ -45,13 +44,18 @@ class JarTypeFilter extends DependencyFilter {
@Override
@Override
protected
boolean
filter
(
Artifact
artifact
)
{
protected
boolean
filter
(
Artifact
artifact
)
{
try
(
JarFile
jarFile
=
new
JarFile
(
artifact
.
getFile
()))
{
try
(
JarFile
jarFile
=
new
JarFile
(
artifact
.
getFile
()))
{
return
Optional
.
ofNullable
(
jarFile
.
getManifest
()).
map
(
Manifest:
:
getMainAttributes
)
Manifest
manifest
=
jarFile
.
getManifest
();
.
map
((
attributes
)
->
attributes
.
getValue
(
"Spring-Boot-Jar-Type"
)).
map
(
EXCLUDED_JAR_TYPES:
:
contains
)
if
(
manifest
!=
null
)
{
.
orElse
(
Boolean
.
FALSE
);
String
jarType
=
manifest
.
getMainAttributes
().
getValue
(
"Spring-Boot-Jar-Type"
);
if
(
jarType
!=
null
&&
EXCLUDED_JAR_TYPES
.
contains
(
jarType
))
{
return
true
;
}
}
}
}
catch
(
IOException
ex
)
{
catch
(
IOException
ex
)
{
return
false
;
// Continue
}
}
return
false
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment