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
57db621b
Commit
57db621b
authored
Jan 23, 2020
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
77bbe089
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
BootJar.java
...g/springframework/boot/gradle/tasks/bundling/BootJar.java
+2
-2
Packager.java
.../java/org/springframework/boot/loader/tools/Packager.java
+7
-6
No files found.
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java
View file @
57db621b
...
@@ -177,8 +177,8 @@ public class BootJar extends Jar implements BootArchive {
...
@@ -177,8 +177,8 @@ public class BootJar extends Jar implements BootArchive {
this
.
bootInf
.
eachFile
((
details
)
->
{
this
.
bootInf
.
eachFile
((
details
)
->
{
Layer
layer
=
layerForFileDetails
(
details
);
Layer
layer
=
layerForFileDetails
(
details
);
if
(
layer
!=
null
)
{
if
(
layer
!=
null
)
{
details
.
setPath
(
String
relativePath
=
details
.
getPath
().
substring
(
"BOOT-INF/"
.
length
());
BOOT_INF_LAYERS
+
"/"
+
layer
+
"/"
+
details
.
getPath
().
substring
(
"BOOT-INF/"
.
length
())
);
details
.
setPath
(
BOOT_INF_LAYERS
+
"/"
+
layer
+
"/"
+
relativePath
);
}
}
}).
setIncludeEmptyDirs
(
false
);
}).
setIncludeEmptyDirs
(
false
);
this
.
bootInf
.
into
(
""
,
(
spec
)
->
spec
.
from
(
createLayersIndex
()));
this
.
bootInf
.
into
(
""
,
(
spec
)
->
spec
.
from
(
createLayersIndex
()));
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java
View file @
57db621b
...
@@ -159,6 +159,7 @@ public abstract class Packager {
...
@@ -159,6 +159,7 @@ public abstract class Packager {
writeLoaderClasses
(
writer
);
writeLoaderClasses
(
writer
);
writer
.
writeEntries
(
sourceJar
,
getEntityTransformer
(),
writeableLibraries
);
writer
.
writeEntries
(
sourceJar
,
getEntityTransformer
(),
writeableLibraries
);
writeableLibraries
.
write
(
writer
);
writeableLibraries
.
write
(
writer
);
writeLayerIndex
(
writer
);
writeLayerIndex
(
writer
);
}
}
...
@@ -425,14 +426,14 @@ public abstract class Packager {
...
@@ -425,14 +426,14 @@ public abstract class Packager {
*/
*/
private
final
class
WritableLibraries
implements
UnpackHandler
{
private
final
class
WritableLibraries
implements
UnpackHandler
{
private
final
Map
<
String
,
Library
>
librar
yEntryNam
es
=
new
LinkedHashMap
<>();
private
final
Map
<
String
,
Library
>
librar
i
es
=
new
LinkedHashMap
<>();
WritableLibraries
(
Libraries
libraries
)
throws
IOException
{
WritableLibraries
(
Libraries
libraries
)
throws
IOException
{
libraries
.
doWithLibraries
((
library
)
->
{
libraries
.
doWithLibraries
((
library
)
->
{
if
(
isZip
(
library
.
getFile
()))
{
if
(
isZip
(
library
.
getFile
()))
{
String
location
=
getLocation
(
library
);
String
location
=
getLocation
(
library
);
if
(
location
!=
null
)
{
if
(
location
!=
null
)
{
Library
existing
=
this
.
librar
yEntryNam
es
.
putIfAbsent
(
location
+
library
.
getName
(),
library
);
Library
existing
=
this
.
librar
i
es
.
putIfAbsent
(
location
+
library
.
getName
(),
library
);
Assert
.
state
(
existing
==
null
,
"Duplicate library "
+
library
.
getName
());
Assert
.
state
(
existing
==
null
,
"Duplicate library "
+
library
.
getName
());
}
}
}
}
...
@@ -452,25 +453,25 @@ public abstract class Packager {
...
@@ -452,25 +453,25 @@ public abstract class Packager {
@Override
@Override
public
boolean
requiresUnpack
(
String
name
)
{
public
boolean
requiresUnpack
(
String
name
)
{
Library
library
=
this
.
librar
yEntryNam
es
.
get
(
name
);
Library
library
=
this
.
librar
i
es
.
get
(
name
);
return
library
!=
null
&&
library
.
isUnpackRequired
();
return
library
!=
null
&&
library
.
isUnpackRequired
();
}
}
@Override
@Override
public
String
sha1Hash
(
String
name
)
throws
IOException
{
public
String
sha1Hash
(
String
name
)
throws
IOException
{
Library
library
=
this
.
librar
yEntryNam
es
.
get
(
name
);
Library
library
=
this
.
librar
i
es
.
get
(
name
);
Assert
.
notNull
(
library
,
"No library found for entry name '"
+
name
+
"'"
);
Assert
.
notNull
(
library
,
"No library found for entry name '"
+
name
+
"'"
);
return
FileUtils
.
sha1Hash
(
library
.
getFile
());
return
FileUtils
.
sha1Hash
(
library
.
getFile
());
}
}
private
void
write
(
AbstractJarWriter
writer
)
throws
IOException
{
private
void
write
(
AbstractJarWriter
writer
)
throws
IOException
{
for
(
Entry
<
String
,
Library
>
entry
:
this
.
librar
yEntryNam
es
.
entrySet
())
{
for
(
Entry
<
String
,
Library
>
entry
:
this
.
librar
i
es
.
entrySet
())
{
writer
.
writeNestedLibrary
(
entry
.
getKey
().
substring
(
0
,
entry
.
getKey
().
lastIndexOf
(
'/'
)
+
1
),
writer
.
writeNestedLibrary
(
entry
.
getKey
().
substring
(
0
,
entry
.
getKey
().
lastIndexOf
(
'/'
)
+
1
),
entry
.
getValue
());
entry
.
getValue
());
}
}
if
(
getLayout
()
instanceof
RepackagingLayout
)
{
if
(
getLayout
()
instanceof
RepackagingLayout
)
{
String
location
=
((
RepackagingLayout
)
getLayout
()).
getClasspathIndexFileLocation
();
String
location
=
((
RepackagingLayout
)
getLayout
()).
getClasspathIndexFileLocation
();
writer
.
writeIndexFile
(
location
,
new
ArrayList
<>(
this
.
librar
yEntryNam
es
.
keySet
()));
writer
.
writeIndexFile
(
location
,
new
ArrayList
<>(
this
.
librar
i
es
.
keySet
()));
}
}
}
}
...
...
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