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
43256ee7
Commit
43256ee7
authored
Apr 15, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.3.x'
parents
06c1dd87
b554894b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
ChangeableUrls.java
...springframework/boot/devtools/restart/ChangeableUrls.java
+3
-0
ChangeableUrlsTests.java
...gframework/boot/devtools/restart/ChangeableUrlsTests.java
+12
-3
No files found.
spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/ChangeableUrls.java
View file @
43256ee7
...
...
@@ -118,6 +118,9 @@ final class ChangeableUrls implements Iterable<URL> {
}
private
static
List
<
URL
>
getUrlsFromClassPathAttribute
(
URL
base
,
Manifest
manifest
)
{
if
(
manifest
==
null
)
{
return
Collections
.<
URL
>
emptyList
();
}
String
classPath
=
manifest
.
getMainAttributes
()
.
getValue
(
Attributes
.
Name
.
CLASS_PATH
);
if
(!
StringUtils
.
hasText
(
classPath
))
{
...
...
spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java
View file @
43256ee7
...
...
@@ -24,6 +24,7 @@ import java.net.URLClassLoader;
import
java.util.jar.Attributes
;
import
java.util.jar.JarOutputStream
;
import
java.util.jar.Manifest
;
import
java.util.zip.ZipOutputStream
;
import
org.junit.Rule
;
import
org.junit.Test
;
...
...
@@ -76,9 +77,11 @@ public class ChangeableUrlsTests {
URL
projectCore
=
makeUrl
(
"project-core"
);
URL
projectWeb
=
makeUrl
(
"project-web"
);
File
relative
=
this
.
temporaryFolder
.
newFolder
();
ChangeableUrls
urls
=
ChangeableUrls
.
fromUrlClassLoader
(
new
URLClassLoader
(
new
URL
[]
{
makeJarFileWithUrlsInManifestClassPath
(
projectCore
,
projectWeb
,
relative
.
getName
()
+
"/"
)
}));
ChangeableUrls
urls
=
ChangeableUrls
.
fromUrlClassLoader
(
new
URLClassLoader
(
new
URL
[]
{
makeJarFileWithUrlsInManifestClassPath
(
projectCore
,
projectWeb
,
relative
.
getName
()
+
"/"
),
makeJarFileWithNoManifest
()
}));
assertThat
(
urls
.
toList
()).
containsExactly
(
projectCore
,
projectWeb
,
relative
.
toURI
().
toURL
());
}
...
...
@@ -103,4 +106,10 @@ public class ChangeableUrlsTests {
return
classpathJar
.
toURI
().
toURL
();
}
private
URL
makeJarFileWithNoManifest
()
throws
Exception
{
File
classpathJar
=
this
.
temporaryFolder
.
newFile
(
"no-manifest.jar"
);
new
ZipOutputStream
(
new
FileOutputStream
(
classpathJar
)).
close
();
return
classpathJar
.
toURI
().
toURL
();
}
}
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