Fork me on GitHub

JRubyExec conflict on jrubyVersion

Table of Contents

What’s going on?

The JRubyExec task allows the user to define a specific version of JRuby via the jrubyVersion property. This requires the requested version of JRuby to be added to a dependency graph. In order to prevent unintentional conflicts in the dependency graph, the base plugin will prevent a JRubyExec task from adding a different JRuby version to the default jrubyExec configuration.

How to fix it

Fixing this behavior is relatively easy, the JRubyExec task which requires its own custom version of JRuby to be installed should also use a custom, user-defined, configuration. E.g.

configurations {

dependencies {
    backwardsCompat 'rubygems:sinatra:1.0.0'

task checkBackwardsCompatibility(type: JRubyExec) {
    configuration backwardsCompat
    script 'smoke-test.rb'
    jrubyVersion '1.7.19'

Okay, that didn’t work

If that work-around didn’t help fix the issue, then you may have encountered an unknown bug!. Please file an issue so we can correct the broken behavior!

  • issue #157 captures the first reported side-effect of the previous behavior which led to the restriction behind defined in the base plugin

improve this page