Skip to content

Commit 56d8477

Browse files
committed
Play JAVA_OPTS
Previously the Play JAVA_OPTS mapping (adding a -J before all of them) didn't work properly as it added a -J anywhere there was a -. This change fixes that problem. [resolves #460]
1 parent 2c56a8e commit 56d8477

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/java_buildpack/util/play/post22.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def augment_classpath
3939

4040
# (see JavaBuildpack::Util::Play::Base#java_opts)
4141
def java_opts
42-
'${JAVA_OPTS//-/-J-}'
42+
'$(for I in $JAVA_OPTS ; do echo "-J$I" ; done)'
4343
end
4444

4545
# (see JavaBuildpack::Util::Play::Base#lib_dir)

spec/java_buildpack/util/play/post22_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
it 'returns command' do
4949
expect(play_app.release).to eq('test-var-2 test-var-1 PATH=$PWD/.test-java-home/bin:$PATH ' \
50-
"#{java_home.as_env_var} exec $PWD/bin/play-application ${JAVA_OPTS//-/-J-}")
50+
"#{java_home.as_env_var} exec $PWD/bin/play-application $(for I in $JAVA_OPTS ; do echo \"-J$I\" ; done)")
5151
end
5252

5353
context do

0 commit comments

Comments
 (0)