Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/java_buildpack/framework/luna_security_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def release

if @droplet.java_home.java_9_or_later?
@droplet.root_libraries << luna_provider_jar

@droplet.environment_variables.add_environment_variable(
'LD_LIBRARY_PATH', "$LD_LIBRARY_PATH:#{ld_lib_path}"
)
else
@droplet.extension_directories << ext_dir
end
Expand Down Expand Up @@ -128,6 +132,10 @@ def lib_cklog
@droplet.sandbox + 'libs/64/libcklog2.so'
end

def ld_lib_path
qualify_path(@droplet.sandbox, @droplet.root) + '/jsp/64/'
end

def setup_ext_dir
FileUtils.mkdir ext_dir
[luna_provider_jar, luna_api_so].each do |file|
Expand Down
12 changes: 9 additions & 3 deletions spec/java_buildpack/framework/luna_security_provider_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,32 @@
delegate
end

it 'adds JAR to classpath during compile in Java 9',
it 'adds JAR to classpath during compile in Java 9+',
cache_fixture: 'stub-luna-security-provider.tar' do

component.compile

expect(root_libraries).to include(droplet.sandbox + 'jsp/LunaProvider.jar')
end

it 'adds JAR to classpath during release in Java 9' do
it 'adds JAR to classpath during release in Java 9+' do
component.release

expect(root_libraries).to include(droplet.sandbox + 'jsp/LunaProvider.jar')
end

it 'adds does not add extension directory in Java 9' do
it 'does not add extension directory in Java 9+' do
component.release

expect(extension_directories).not_to include(droplet.sandbox + 'ext')
end

it 'updates environment variables for Java 9+' do
component.release
expect(environment_variables).to include(
'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/.java-buildpack/luna_security_provider/jsp/64/'
)
end
end

context do
Expand Down