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
8c106af3
Commit
8c106af3
authored
Aug 11, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow default value for CONF_FOLDER to be set at build time
Closes gh-6549
parent
1d58247e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
deployment.adoc
spring-boot-docs/src/main/asciidoc/deployment.adoc
+3
-0
DefaultLaunchScript.java
...pringframework/boot/loader/tools/DefaultLaunchScript.java
+2
-2
launch.script
...urces/org/springframework/boot/loader/tools/launch.script
+1
-1
DefaultLaunchScriptTests.java
...framework/boot/loader/tools/DefaultLaunchScriptTests.java
+5
-0
No files found.
spring-boot-docs/src/main/asciidoc/deployment.adoc
View file @
8c106af3
...
...
@@ -608,6 +608,9 @@ for Gradle and to `${project.name}` for Maven.
|`initInfoChkconfig`
|The `chkconfig` section of "`INIT INFO`". Defaults to `2345 99 01`.
|`confFolder`
|The default value for `CONF_FOLDER`. Defaults to the folder containing the jar.
|`logFolder`
|The default value for `LOG_FOLDER`. Only valid for an `init.d` service.
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultLaunchScript.java
View file @
8c106af3
...
...
@@ -42,7 +42,7 @@ public class DefaultLaunchScript implements LaunchScript {
private
static
final
int
BUFFER_SIZE
=
4096
;
private
static
final
Pattern
PLACEHOLDER_PATTERN
=
Pattern
.
compile
(
"\\{\\{(\\w+)(:.*?)?\\}\\}"
);
.
compile
(
"\\{\\{(\\w+)(:.*?)?\\}\\}
(?!\\})
"
);
private
final
String
content
;
...
...
@@ -97,7 +97,7 @@ public class DefaultLaunchScript implements LaunchScript {
else
{
value
=
(
value
==
null
?
matcher
.
group
(
0
)
:
value
.
substring
(
1
));
}
matcher
.
appendReplacement
(
expanded
,
value
);
matcher
.
appendReplacement
(
expanded
,
value
.
replace
(
"$"
,
"\\$"
)
);
}
matcher
.
appendTail
(
expanded
);
return
expanded
.
toString
();
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script
View file @
8c106af3
...
...
@@ -44,7 +44,7 @@ cd "$WORKING_DIR" || exit 1
configfile
=
"
$(
basename
"
${
jarfile
%.*
}
.conf"
)
"
# Initialize CONF_FOLDER location defaulting to jarfolder
[[
-z
"
$CONF_FOLDER
"
]]
&&
CONF_FOLDER
=
"
${
jarfolder
}
"
[[
-z
"
$CONF_FOLDER
"
]]
&&
CONF_FOLDER
=
"
{{confFolder:
${
jarfolder
}
}
}"
# shellcheck source=/dev/null
[[
-r
"
${
CONF_FOLDER
}
/
${
configfile
}
"
]]
&&
source
"
${
CONF_FOLDER
}
/
${
configfile
}
"
...
...
spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/DefaultLaunchScriptTests.java
View file @
8c106af3
...
...
@@ -86,6 +86,11 @@ public class DefaultLaunchScriptTests {
assertThatPlaceholderCanBeReplaced
(
"pidFolder"
);
}
@Test
public
void
confFolderCanBeReplaced
()
throws
Exception
{
assertThatPlaceholderCanBeReplaced
(
"confFolder"
);
}
@Test
public
void
defaultForUseStartStopDaemonIsTrue
()
throws
Exception
{
DefaultLaunchScript
script
=
new
DefaultLaunchScript
(
null
,
null
);
...
...
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