You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by decebal <de...@gmail.com> on 2018/12/19 11:49:02 UTC

Dependency with dynamic revision

Hi,

In my project I encounter a problem when I try to retrieve dependencies. The
message is:

[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve] 		module not found:
bundle#org.eclipse.ui.workbench;[3.112.0,4.0.0)
[ivy:retrieve] 	==== eclipse: tried
[ivy:retrieve] 	  [3.112.0.v20180906-1121]

If I run in debug mode (with "-debug" flag as argument) I see the below
message:

Non matching revision detected when sorting.  Dependency
bundle#org.eclipse.ui.workbench;[3.112.0,4.0.0) doesn't match
bundle#org.eclipse.ui.workbench;3.112.0.v20180906-1121

In documentation
(http://ant.apache.org/ivy/history/master/ivyfile/dependency.html) we have
this:
"[1.0,) matches all versions greater or equal to 1.0"

My question is why 3.112.0.v20180906-1121 is not matched with
[3.112.0,4.0.0), what can I do to resolve the problem?

Other useful information:
- Ivy version 2.4.0
- "org.eclipse.ui.workbench" is a transitive dependency, my ivy.xml
(fragment) looks like:


<dependency org="bundle" name="org.eclipse.core.resources"
rev="latest.integration" conf="eclipse-runtime" transitive="false"/>
<dependency org="bundle" name="org.eclipse.core.jobs"
rev="latest.integration" conf="eclipse-runtime" transitive="false"/>
<dependency org="bundle" name="org.eclipse.equinox.common"
rev="latest.integration" conf="eclipse-runtime" transitive="false"/>


<dependency org="bundle" name="org.eclipse.team.cvs.core"
rev="latest.integration" conf="eclipse"/>
<dependency org="bundle" name="org.eclipse.compare" rev="latest.integration"
conf="eclipse"/>
<dependency org="bundle" name="org.eclipse.swt.win32.win32.x86_64"
rev="latest.integration" conf="eclipse"/>

My ivysettings (fragment) looks like:

<chain name="main" returnFirst="true">
    <obr name="eclipse"
repoXmlFile="${ivy.settings.dir}/ivy/repo-eclipse.xml"/>
    <ibiblio name="acme" root="${ivy.base.url}/libs" m2compatible="true" />
</chain>

where "${ivy.base.url}" is a property with value
http://acme.com/artifactory.

My build.xml (fragment) looks like:

<target name="ivy.update" depends="ivy.install, ivy.buildobr"
description="Download project dependencies">
    <ivy:settings file="ivysettings.xml" />
    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" type="jar"
sync="true"/>
</target>

<target name="ivy.buildobr" depends="ivy.install">
    
    <ivy:buildobr baseDir="${eclipse.home}"
out="${ivy.dir}/repo-eclipse.xml" indent="true"/>
</target>

The build script is used to build an Eclipse plugin.

If you need more information please let me know.

Thanks in advance,
Decebal




--
Sent from: http://apache-ivy.996301.n3.nabble.com/ivy-user-f3.html

Re: Dependency with dynamic revision

Posted by decebal <de...@gmail.com>.
Hi Jaikiran,

Thanks for your response!
I will try what you recommend here (using "latest-osgi" strategy).
For the moment, I solved the problem using an workaround. So, what I did was
to downgrade (switch to previous) the required version. To do this I
modified the repo-eclipse.xml file generated by ivy:buildobr, so instead of
[3.112.0,4.0.0) I put [3.110.0,4.0.0).




--
Sent from: http://apache-ivy.996301.n3.nabble.com/ivy-user-f3.html

Re: Dependency with dynamic revision

Posted by Jaikiran Pai <ja...@apache.org>.
On 19/12/18 9:30 PM, decebal wrote:
> So, to simplify the problem, why this not matching message:
>
>
>> Non matching revision detected when sorting.  Dependency
>> bundle#org.eclipse.ui.workbench[3.112.0,4.0.0) doesn't match
>> bundle#org.eclipse.ui.workbench;3.112.0.v20180906-1121 
> The message is normal/correct? I think that no, we have [3.112.0,4.0.0) and
> 3.112.0.v20180906-1121. Is it possible to be a bug?

The "latest-revision" strategy used by the version range matcher is
incapable of understanding 3.112.0.v20180906-1121 (which looks like OSGi
version scheme). I would have recommended using "latest-osgi" strategy,
like something below in your ivysettings.xml:

    <typedef name="version-range"
classname="org.apache.ivy.plugins.version.VersionRangeMatcher"/>
    <version-matchers usedefaults="true">
        <version-range latest="latest-osgi"/>
    </version-matchers>       

But then I looked at some of your dependencies and tried it out myself
and it looks like not all those dependency versions are compatible with
OSGi version scheme and as a result the version matcher keeps failing.

-Jaikiran


Re: Dependency with dynamic revision

Posted by decebal <de...@gmail.com>.
So, to simplify the problem, why this not matching message:


> Non matching revision detected when sorting.  Dependency
> bundle#org.eclipse.ui.workbench[3.112.0,4.0.0) doesn't match
> bundle#org.eclipse.ui.workbench;3.112.0.v20180906-1121 

The message is normal/correct? I think that no, we have [3.112.0,4.0.0) and
3.112.0.v20180906-1121. Is it possible to be a bug?

I think that from this cause, the retrieve process fails.




--
Sent from: http://apache-ivy.996301.n3.nabble.com/ivy-user-f3.html