File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
lib/java_buildpack/framework
spec/java_buildpack/framework Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1717---
1818version : 7.+
1919repository_root : https://dl.zeroturnaround.com/jrebel
20+ enabled : true
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ The framework can be configured by modifying the [`config/jrebel_agent.yml`][] f
2525| ---- | -----------
2626| ` repository_root ` | The URL of the JRebel repository index ([ details] [ repositories ] ).
2727| ` version ` | The version of JRebel to use. Candidate versions can be found in [ this listing] [ ] .
28+ | ` enabled ` | Whether to activate JRebel (upon the presence of ` rebel-remote.xml ` ) or not.
2829
2930[ Configuration and Extension ] : ../README.md#configuration-and-extension
3031[ `config/jrebel_agent.yml` ] : ../config/jrebel_agent.yml
Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ def release
4646
4747 # (see JavaBuildpack::Component::VersionedDependencyComponent#supports?)
4848 def supports?
49- jrebel_configured? ( @application . root ) || jrebel_configured? ( @application . root + 'WEB-INF/classes' ) ||
50- jars_with_jrebel_configured? ( @application . root )
49+ enabled? && (
50+ jrebel_configured? ( @application . root ) ||
51+ jrebel_configured? ( @application . root + 'WEB-INF/classes' ) ||
52+ jars_with_jrebel_configured? ( @application . root ) )
5153 end
5254
5355 private
@@ -68,6 +70,10 @@ def architecture
6870 `uname -m` . strip
6971 end
7072
73+ def enabled?
74+ @configuration [ 'enabled' ] . nil? || @configuration [ 'enabled' ]
75+ end
76+
7177 end
7278
7379 end
Original file line number Diff line number Diff line change 3939 expect ( component . detect ) . to eq ( "jrebel-agent=#{ version } " )
4040 end
4141
42+ context do
43+ let ( :configuration ) { { 'enabled' => false } }
44+
45+ it 'does not detect when not enabled' ,
46+ app_fixture : 'framework_jrebel_app_simple' do
47+ expect ( component . detect ) . to be_nil
48+ end
49+ end
50+
4251 it 'downloads the JRebel JAR and the native agent' ,
4352 app_fixture : 'framework_jrebel_app_simple' ,
4453 cache_fixture : 'stub-jrebel-archive.zip' do
You can’t perform that action at this time.
0 commit comments