jruby-gradle.github.io/errors/jrubyexec-version-conflict/index.html

128 lines
3.9 KiB
HTML

<html>
<head>
<link href='/stylesheets/foundation.css' rel='stylesheet'>
<link href='/stylesheets/jrubygradle.css' rel='stylesheet'>
<link href='/news.atom' rel='alternate' title='JRuby/Gradle News' type='application/atom+xml'>
<title>
JRubyExec conflict on jrubyVersion
</title>
</head>
<body>
<a href='https://github.com/jruby-gradle'>
<img alt='Fork me on GitHub' data-canonical-src='https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png' src='https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67' style='position: absolute; top: 0; right: 0; border: 0;'>
</a>
<div id='main_nav'>
<ul>
<li>
<a href='/'>
Home
</a>
</li>
<li>
<a href='/docs/'>
Documentation
</a>
</li>
<li>
<a href='/community/'>
Community
</a>
</li>
<li>
<a href='/news/'>
News
</a>
</li>
<li>
<a href='/download/'>
Download
</a>
</li>
<li>
<a href='https://travis-ci.org/jruby-gradle/jruby-gradle-plugin'>
<img src='https://travis-ci.org/jruby-gradle/jruby-gradle-plugin.svg?branch=master'>
</a>
</li>
<li>
<a href='https://bintray.com/jruby-gradle/plugins'>
<img src='https://api.bintray.com/packages/jruby-gradle/plugins/jruby-gradle-plugin/images/download.svg'>
</a>
</li>
</ul>
</div>
<div id='content'>
<h1>
JRubyExec conflict on jrubyVersion
</h1>
<div class="sect1">
<h2 id="what-s-going-on"><a class="anchor" href="#what-s-going-on"></a>What&#8217;s going on?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The
<a href="/groovydoc/jruby-gradle-base-plugin/com/github/jrubygradle/JRubyExec.html">JRubyExec</a>
task allows the user to define a specific version of
<a href="http://jruby.org">JRuby</a> via the <code>jrubyVersion</code> 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 <a href="/base/">base</a>
plugin will prevent a <code>JRubyExec</code> task from adding a different JRuby version to
the <em>default</em> <code>jrubyExec</code>
<a href="https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html">configuration</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="how-to-fix-it"><a class="anchor" href="#how-to-fix-it"></a>How to fix it</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Fixing this behavior is relatively easy, the <code>JRubyExec</code> task which requires
its own custom version of JRuby to be installed should <em>also</em> use a custom,
user-defined, <a href="https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.Configuration.html">configuration</a>. E.g.</p>
</div>
<div class="listingblock">
<div class="title">build.gradle</div>
<div class="content">
<pre class="CodeRay highlight nowrap"><code data-lang="gradle">configurations {
backwardsCompat
}
dependencies {
backwardsCompat 'rubygems:sinatra:1.0.0'
}
task checkBackwardsCompatibility(type: JRubyExec) {
configuration backwardsCompat
script 'smoke-test.rb'
jrubyVersion '1.7.19'
}</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="okay-that-didn-t-work"><a class="anchor" href="#okay-that-didn-t-work"></a>Okay, that didn&#8217;t work</h3>
<div class="paragraph">
<p>If that work-around didn&#8217;t help fix the issue, then you may have encountered an
unknown <strong>bug!</strong>. Please
<a href="https://github.com/jruby-gradle/jruby-gradle-plugin/issues">file an issue</a>
so we can correct the broken behavior!</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="links"><a class="anchor" href="#links"></a>Links</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/jruby-gradle/jruby-gradle-plugin/issues/157">issue #157</a>
captures the first reported side-effect of the previous behavior which
led to the restriction behind defined in the <a href="/base/">base</a> plugin</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<hr>
</body>
</html>