<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Inconsistency range version between Gradle declaration and MANIFEST file</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110999171" />
  <subtitle>Inconsistency range version between Gradle declaration and MANIFEST file</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=110999171</id>
  <updated>2026-04-04T09:15:02Z</updated>
  <dc:date>2026-04-04T09:15:02Z</dc:date>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111021211" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111021211</id>
    <updated>2018-09-24T13:27:25Z</updated>
    <published>2018-09-24T13:27:25Z</published>
    <summary type="html">&lt;p&gt;Likely the choice of repo.  The liferay workspace points at Liferay's
  repo where they release snapshot versions.  I think gradle would
  consistently pick the right version, all things being equal.&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-09-24T13:27:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111017501" />
    <author>
      <name>Enrico Oliosi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111017501</id>
    <updated>2018-09-24T08:48:24Z</updated>
    <published>2018-09-24T08:48:24Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Milen Dyankov:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;It is in fact correct behavior, even though not the one you
        want !&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;
        &lt;cite&gt;Why does it use&amp;nbsp;2.13.0-SNAPSHOT and not&amp;nbsp;2.12 of the portal kernel?&lt;/cite&gt;&lt;/p&gt;
      &lt;p&gt;Because you told it to do so in your gradle file.
        The&amp;nbsp;2.13.0-SNAPSHOT is the most recent one with respect to
        the&amp;nbsp;[2.6.0,2.13.0) interval.&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;p&gt;I guess what you need is&amp;nbsp;to tell Gradle to not use&amp;nbsp;SNAPSHOT
        dependencies. But I have no idea how to do that in Gradle.&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Hi Milen, I created a project using Liferay workspace anche another
  without it. I used the same Gradle version (4.4.1) and I got this scenario:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
  &lt;code&gt;//With LF workspace and&amp;amp;nbsp;Gradle version 4.4.1&amp;lt;br&amp;gt; λ blade gw
    dependencies | grep "com.liferay.portal.kernel"&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt;
    2.13.0-SNAPSHOT&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt;
    2.13.0-SNAPSHOT&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt; 2.13.0-SNAPSHOT&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;br&gt;
  &lt;code&gt;//...without LF workspace and&amp;amp;nbsp;Gradle version 4.4.1&amp;lt;br&amp;gt; λ
    &amp;amp;nbsp;./gradlew budapest:dependencies | grep
    "com.liferay.portal.kernel:"&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt;
    2.12.0&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt;
    2.12.0&amp;lt;br&amp;gt; +---
    com.liferay.portal:com.liferay.portal.kernel:[2.6.0,2.13.0) -&amp;amp;gt; 2.12.0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is something that I am not able to catch...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Enrico Oliosi</dc:creator>
    <dc:date>2018-09-24T08:48:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111013909" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111013909</id>
    <updated>2018-09-22T01:22:50Z</updated>
    <published>2018-09-22T01:22:50Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Enrico Oliosi:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;But reading &lt;a
          href="https://community.liferay.com/blogs/-/blogs/choosing-osgi-versions-during-development"&gt;this
        article &lt;/a&gt;written by David (where he cites Milen also), he
        describes a scenario where the range version could be a need.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Sorry about the confusion on that, Enrico.&lt;/p&gt;
&lt;p&gt;I've updated the post and put a section at the bottom explaining the
  use of a version in your build.gradle file vs declaring a version
  range in the Import-Package directive in your bnd.bnd file.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-09-22T01:22:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111013214" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111013214</id>
    <updated>2018-09-22T00:30:14Z</updated>
    <published>2018-09-22T00:30:14Z</published>
    <summary type="html">&lt;p&gt;And to carry the thought further, I only use version ranges in my
  bnd.bnd file.&lt;/p&gt;
&lt;p&gt;In the build.gradle file, you're specifically choosing a version that
  has the API that you want to compile against, but that is a direct
  compile-time dependency.&lt;/p&gt;
&lt;p&gt;The runtime version range, defined in your bnd.bnd file, defines the
  version of the package that you are okay to bind against.&lt;/p&gt;
&lt;p&gt;
  &lt;em&gt;&amp;gt; I believe &amp;quot;Completely transparent upgrades because my
    version ranges control where the code runs!&amp;quot; was a joke that
    was lost in translation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;No, I wasn't really joking there...&lt;/p&gt;
&lt;p&gt;If I have two bundles, one bnd.bnd says it has an Import-Package
  range on com.liferay.portal.kernel.dao.search from (2.6.0,2.13.0] and
  I have a second module that has the Import-Package range from
  (2.13.0,3.0.0], only one of these will be satisfied and will be active
  at any given time.  I can deploy both modules to a Liferay instance
  and forget about it.  If the version is 2.10.0 when I first deploy the
  modules, only the first one will be active.  If a fixpack is deployed
  that increases the version to 2.20.0, the second one will be the
  active one.&lt;/p&gt;
&lt;p&gt;So even though the portal upgrades, it is transparent to my code
  because I have two bundles deployed to take advantage of the available version.&lt;/p&gt;
&lt;p&gt;I don't know how often that really happens, though.  I tend to do FPs
  in the lower lanes far in advance of what goes to prod, but rarely
  does my code need to be deployed to the higher lanes ahead of FP promotion.&lt;/p&gt;
&lt;p&gt;Who knows, maybe folks out there take a long time to thoroughly test
  the fix packs, so if their custom code gets updated and deployed ahead
  of the FP promotions, this can be a way to have your deployed code
  that is compatible with both versions...&lt;/p&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2018-09-22T00:30:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111010729" />
    <author>
      <name>Minhchau Dang</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111010729</id>
    <updated>2018-09-21T16:52:32Z</updated>
    <published>2018-09-21T16:52:32Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;Yep&amp;nbsp;Minhchau, you're right, but reading &lt;a href="https://community.liferay.com/blogs/-/blogs/choosing-osgi-versions-during-development"&gt;this
        article&amp;nbsp;&lt;/a&gt;written by David (where he&amp;nbsp;cites Milen also), he
        describes&amp;nbsp;a scenario where the range version could be&amp;nbsp;a need.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Aha. The main thrust of that blog post was, "You always want to
  pick the oldest version you can get away with (relative to the major
  version number)." Always a fixed version (for repeatable builds),
  as old as possible (so you can get the widest possible bnd-generated
  package version range).&lt;/p&gt;
&lt;p&gt;I believe "Completely transparent upgrades because my version
  ranges control where the code runs!" was a joke that was lost in
  translation. You don't usually get transparent upgrades from changing
  your Gradle except in very specific circumstances (which you could
  also achieve with &lt;code&gt;bnd.bnd&lt;/code&gt; changes), and usually they're
  unexpected (like with &lt;a href="https://community.liferay.com/it/blogs/-/blogs/keeping-customizations-up-to-date-with-liferay-source"&gt;terms
    of use content providers&lt;/a&gt;).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Minhchau Dang</dc:creator>
    <dc:date>2018-09-21T16:52:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111006322" />
    <author>
      <name>Enrico Oliosi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111006322</id>
    <updated>2018-09-21T07:29:36Z</updated>
    <published>2018-09-21T07:29:36Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Minhchau Dang:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;Which leads me to ask the question: why are you using version
        ranges? Maybe I'm overly paranoid, but version ranges make your
        build non-repeatable and introduce security risks (like what
        happens whenever &lt;code&gt;npm&lt;/code&gt; releases are compromised,
        since node.js developers tend to use version ranges on their
        dependencies), so to me, there needs to be a compelling reason
        not to specify a fixed version.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Yep&amp;nbsp;Minhchau, you're right, but reading &lt;a href="https://community.liferay.com/blogs/-/blogs/choosing-osgi-versions-during-development"&gt;this
  article&amp;nbsp;&lt;/a&gt;written by David (where he&amp;nbsp;cites Milen also), he
  describes&amp;nbsp;a scenario where the range version could be&amp;nbsp;a need.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Enrico Oliosi</dc:creator>
    <dc:date>2018-09-21T07:29:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111001021" />
    <author>
      <name>Minhchau Dang</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111001021</id>
    <updated>2018-09-20T19:27:37Z</updated>
    <published>2018-09-20T19:27:37Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Milen Dyankov:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;I guess what you need is&amp;nbsp;to tell Gradle to not use&amp;nbsp;SNAPSHOT
        dependencies. But I have no idea how to do that in Gradle.&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;A quick search indicates it's not trivial. There's a &lt;a href="https://gist.github.com/Ithildir/b2fb163216d6dd96ca29c304bb2f3ce9"&gt;gist&lt;/a&gt;
  from Andrea that tries to demonstrate how to do it by customizing the
  Gradle resolution strategy.&lt;/p&gt;
&lt;blockquote&gt;
  &lt;div class="quote-title"&gt;Enrico Oliosi:&lt;/div&gt;
  &lt;div class="quote"&gt;
    &lt;div class="quote-content"&gt;
      &lt;p&gt;Good morning. I am testing version range into build.gradle
        file, I configured the project like this:&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Which leads me to ask the question: why are you using version ranges?
  Maybe I'm overly paranoid, but version ranges make your build
  non-repeatable and introduce security risks (like what happens
  whenever &lt;code&gt;npm&lt;/code&gt; releases are compromised, since node.js
  developers tend to use version ranges on their dependencies), so to
  me, there needs to be a compelling reason not to specify a fixed version.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Minhchau Dang</dc:creator>
    <dc:date>2018-09-20T19:27:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: Inconsistency range version between Gradle declaration and MANIFEST fil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110999831" />
    <author>
      <name>Milen Dyankov</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110999831</id>
    <updated>2018-09-20T14:11:33Z</updated>
    <published>2018-09-20T14:11:33Z</published>
    <summary type="html">&lt;p&gt;It is in fact correct behavior, even though not the one you want !&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
  &lt;cite&gt;Why does it use 2.13.0-SNAPSHOT and not 2.12 of the portal kernel?&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;Because you told it to do so in your gradle file. The 2.13.0-SNAPSHOT
  is the most recent one with respect to the [2.6.0,2.13.0) interval. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
  &lt;cite&gt;Why does it use version &amp;quot;[1.4&amp;quot; and not
    &amp;quot;[1.3&amp;quot; of &amp;quot;com.liferay.portal.kernel.portlet.bridges.mvc&amp;quot; package&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;Because 1.4.0 is the version of the package exported
  by 2.13.0-SNAPSHOT bundle. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I guess what you need is to tell Gradle to not use SNAPSHOT
  dependencies. But I have no idea how to do that in Gradle. &lt;/p&gt;</summary>
    <dc:creator>Milen Dyankov</dc:creator>
    <dc:date>2018-09-20T14:11:33Z</dc:date>
  </entry>
  <entry>
    <title>Inconsistency range version between Gradle declaration and MANIFEST file</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110999170" />
    <author>
      <name>Enrico Oliosi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110999170</id>
    <updated>2018-09-20T13:56:30Z</updated>
    <published>2018-09-20T13:56:30Z</published>
    <summary type="html">&lt;p&gt;Good morning. I am testing version range into build.gradle file, I
  configured the project like this:&lt;/p&gt;
&lt;pre&gt;
[...]
    dependencies {
        compileOnly group: &amp;quot;com.liferay.portal&amp;quot;, name: &amp;quot;com.liferay.portal.kernel&amp;quot;, version: &amp;quot;[2.6.0,2.13.0)&amp;quot;
        compileOnly group: &amp;quot;com.liferay.portal&amp;quot;, name: &amp;quot;com.liferay.util.taglib&amp;quot;, version: &amp;quot;2.10.9&amp;quot;
        compileOnly group: &amp;quot;javax.portlet&amp;quot;, name: &amp;quot;portlet-api&amp;quot;, version: &amp;quot;2.0&amp;quot;
[...]
&lt;/pre&gt;
&lt;p&gt;I specify to Gradle to get portal-kernel.jar included between
  versions 2.6.0 (included) and 2.13.0 &lt;strong&gt;(excluded)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When I build (with &amp;quot;blade gw build&amp;quot; - I am using liferay
  workspace) my project Gradle downloads portal-kernel 2.13.0-SNAPSHOT
  jar and use this artifact to calculate package interval to create
  MANIFEST.MF of my project.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Into MANIFEST.MF I have:&lt;/p&gt;
&lt;pre&gt;
Import-Package: com.liferay.portal.kernel.portlet.bridges.mvc;version= &amp;quot;[1.4,2)&amp;quot;,[...]&lt;/pre&gt;
&lt;p&gt;but this translation is wrong, because I don't want 1.4 version of
  &amp;quot;com.liferay.portal.kernel.portlet.bridges.mvc&amp;quot;. Infact
  these are &amp;quot;com.liferay.portal.kernel.portlet.bridges.mvc&amp;quot;
  versions for the different portal-kernel.jar versions:&lt;/p&gt;
&lt;p&gt;portal-kernel 2.6.0 exports com.liferay.portal.kernel.portlet.bridges.mvc;version=&amp;quot;1.2.0&amp;quot;&lt;/p&gt;
&lt;p&gt;portal-kernel 2.12.0 exports com.liferay.portal.kernel.portlet.bridges.mvc;version=&amp;quot;1.3.0&amp;quot;&lt;/p&gt;
&lt;p&gt;portal-kernel 2.13.0-SNAPSHOT exports com.liferay.portal.kernel.portlet.bridges.mvc;version=&amp;quot;1.4.0&amp;quot;&lt;/p&gt;
&lt;p&gt;portal-kernel 2.13.0 exports com.liferay.portal.kernel.portlet.bridges.mvc;version=&amp;quot;1.4.0&amp;quot;&lt;/p&gt;
&lt;p&gt;Why does it use 2.13.0-SNAPSHOT and not 2.12 of the portal kernel?
  Why does it use version &amp;quot;[1.4&amp;quot; and not &amp;quot;[1.3&amp;quot; of &amp;quot;com.liferay.portal.kernel.portlet.bridges.mvc&amp;quot; package?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Enrico&lt;/p&gt;</summary>
    <dc:creator>Enrico Oliosi</dc:creator>
    <dc:date>2018-09-20T13:56:30Z</dc:date>
  </entry>
</feed>
