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
76ed52c2
Commit
76ed52c2
authored
Feb 05, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Support nested jar paths in loader.path"
Closes gh-11121
parent
9eb8e3d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
PropertiesLauncher.java
...a/org/springframework/boot/loader/PropertiesLauncher.java
+8
-2
PropertiesLauncherTests.java
.../springframework/boot/loader/PropertiesLauncherTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java
View file @
76ed52c2
...
...
@@ -121,6 +121,8 @@ public class PropertiesLauncher extends Launcher {
private
static
final
Pattern
WORD_SEPARATOR
=
Pattern
.
compile
(
"\\W+"
);
private
static
final
String
NESTED_ARCHIVE_SEPARATOR
=
"!"
+
File
.
separator
;
private
final
File
home
;
private
List
<
String
>
paths
=
new
ArrayList
<>();
...
...
@@ -452,6 +454,7 @@ public class PropertiesLauncher extends Launcher {
private
List
<
Archive
>
getClassPathArchives
(
String
path
)
throws
Exception
{
String
root
=
cleanupPath
(
stripFileUrlPrefix
(
path
));
System
.
out
.
println
(
root
);
List
<
Archive
>
lib
=
new
ArrayList
<>();
File
file
=
new
File
(
root
);
if
(!
"/"
.
equals
(
root
))
{
...
...
@@ -483,8 +486,7 @@ public class PropertiesLauncher extends Launcher {
}
private
Archive
getArchive
(
File
file
)
throws
IOException
{
// Nested path never exists as plain jar file, which should be ignored here.
if
(
file
.
getPath
().
contains
(
"!"
))
{
if
(
isNestedArchivePath
(
file
))
{
return
null
;
}
String
name
=
file
.
getName
().
toLowerCase
();
...
...
@@ -494,6 +496,10 @@ public class PropertiesLauncher extends Launcher {
return
null
;
}
private
boolean
isNestedArchivePath
(
File
file
)
{
return
file
.
getPath
().
contains
(
NESTED_ARCHIVE_SEPARATOR
);
}
private
List
<
Archive
>
getNestedArchives
(
String
path
)
throws
Exception
{
Archive
parent
=
this
.
parent
;
String
root
=
path
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/PropertiesLauncherTests.java
View file @
76ed52c2
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
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