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 efe4it <ex...@sncf.fr> on 2011/05/24 12:59:11 UTC

Re: IvyDE Workspace Resolver

Hi

Small update here, because I had some troubles again with the workspace
resolver.

When using ANT outside Eclipse, I tell it to publish using "trunk" revision. 
Using a non-default publish revision, instead of letting IVY set it to
"working@`host`" leads to strange behavior of IvyDE.

Suppose you cleaned cache and local (user-private) repository. 
1/ Then if you resolve deps with IvyDE, it complains about moduleB not
finding "trunk" revision of moduleA.
That's normal: Local repository is empty, and WorkspaceResolver knows only
of the "working@..." revision of moduleA, because there is nowhere to tell
it what to use instead
2/ Then you run ANT and "moduleA;trunk" is published to local repo. In
Eclipse, no more complains.

Fine, but that's not what you would want: 
IvyDE must find the eclipse projects' revisions in the WorkspaceResolver.
And if possible, ANT & IvyDE must works on the same revision.

To have IvyDE use the same publish revision label (i.e. trunk), I modified
"ivy.xml" and set "revision" attribute of <info> tag to "trunk"

Now IvyDE looks only for trunk revision, that are found in the
WorkspaceResolver

Btw, IvyConsole view helped a lot


HTH

Emmanuel






-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31689250.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by efe4itcc <ef...@gmail.com>.
Notification: 
I upgraded to Indigo but still do not manage to get a reliable behaviour.
I finally decided to disable the workspace resolver. 
This is acceptable in my setup since I am currently doing solo work and I do
not care having to switch to shell and launch ant build.
For teamwork this looks more like a blocker (many people I worked with
happen to dislike being forced to "leave the IDE")

But as other people do not encounter the same difficulties, I believe
something I my configuration must confuse the plugin.
Being a newbie in eclipse plugin development, I do not know whether I will
managed to find out what is amiss.

Regards
-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31999753.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by efe4itcc <ef...@gmail.com>.

I tried a last time to recreate the eclipse project from scrap, and ensuring
their name does not match the ivy-module name anymore.
One done, the resolve fails again.

Then:
1/ I edit ivy file of exception, modifying the name of the module and
artefact.
2/ I edit ivy file of registry, modifying the dependancy

Now it works, and keeps working, even after restarting eclipse.

To summarize the problem: I cannot resolve when "project name is sub-part of
ivy-module name".

Regards
   Emmanuel
-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31821881.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by efe4itcc <ef...@gmail.com>.

Nicolas Lalevée wrote:
> 
> 
> This works fine for me. Since I don't a full setup locally, I remove every
> dependency in the ivy.xml files, except the dependency on win32registry on
> lib-exception.
> Have you tried to clean your caches ?
> 
> Nicolas
> 

Hi Nicolas. 

I indeed did clean the caches many times, both using IvyDE or the ANT task. 

I spend a couple a hours tonight testing around and I finally found out how
to reproduce the bug.

I started from a fresh Eclipse runtime and a new Workspace. Below is the
exact sequence I used.

1/ Downloaded Package Helios SR2 classic 
2/ Added plugins/features: Subclipse TeamProvider & SVNKit for svn-1.6.x,
Eclipse MarketPlace and Easy Shell, then IVY-2.2.0 and IvyDE-2.1.0
3/ Imported my projects from working copy, but keep win32registry closed
4/ Created 2 new projects in default location: moduleA and moduleB
5/ For both created ivy.xml on efe4it's template ivy files. ModuleB depends
on ModuleA and resolve works fine.
6/ Opened win32registry project and resolve fails as before.

Finally I found that resolve does fail when ivy.module matches the project
name, i.e.:
"ivy.xml"!/ivy-module/info@module  == ".project"!/projectDescription/name

To help you test _with_ the dependancy, I added to SVN a tool to setup the
"external" repository used in Javalibs (see also readme)
https://efe4it-suite.googlecode.com/svn/trunk/BuildTools/IVY/CorpRepoInstaller

Emmanuel

-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31821088.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 8 juin 2011 à 22:14, efe4itcc a écrit :

> 
> 
> Nicolas Lalevée wrote:
>> 
>> 
>>>> svn checkout http://efe4it-suite.googlecode.com/svn/trunk/
>>>> efe4it-suite-read-only 
>>>> 
>> 
>> your ivy.xml files looks fine to me. I have been able to make a proper
>> resolve in workspace (I removed every dependency and I used a default
>> ivysettings). Try to clean your caches.
>> If you still have issues, their maybe an issue in your ivysettings, which
>> is not on svn (yet ?).
>> 
>> Nicolas
>> 
>> 
> 
> I now have fixed things and uploaded all required files, along with post
> checkout installation instructions (see project wiki and readme files).
> Let me know if you find anything inappropriate in my settings.
> 
> Commit r16 works fine on my workstation with ANT, but IvyDE still fails for
> win32registry project after first settings reload.

This works fine for me. Since I don't a full setup locally, I remove every dependency in the ivy.xml files, except the dependency on win32registry on lib-exception.
Have you tried to clean your caches ?

Nicolas


Re: IvyDE Workspace Resolver

Posted by efe4itcc <ef...@gmail.com>.

Nicolas Lalevée wrote:
> 
> 
>>> svn checkout http://efe4it-suite.googlecode.com/svn/trunk/
>>> efe4it-suite-read-only 
>>> 
> 
> your ivy.xml files looks fine to me. I have been able to make a proper
> resolve in workspace (I removed every dependency and I used a default
> ivysettings). Try to clean your caches.
> If you still have issues, their maybe an issue in your ivysettings, which
> is not on svn (yet ?).
> 
> Nicolas
> 
> 

I now have fixed things and uploaded all required files, along with post
checkout installation instructions (see project wiki and readme files).
Let me know if you find anything inappropriate in my settings.

Commit r16 works fine on my workstation with ANT, but IvyDE still fails for
win32registry project after first settings reload.

Meanwhile I will try with a fresh Eclipse installation and workspace.


Emmanuel

-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31804082.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 8 juin 2011 à 13:36, efe4it a écrit :

> 
> 
> Nicolas Lalevée wrote:
>> 
>> About how the workspace resolver work, you have to understand that IvyDE
>> is then trying to see the eclipse workspace as an Ivy repository. So the
>> ivy.xml files in the Eclipse project must have enough information so that
>> it really looks like a repository. The only difference should be about the
>> artifacts. Since there is nothing actually published, IvyDE doesn't really
>> care about the <publications> tag in the ivy.xml. But you should not
>> reference any artifact in the dependencies section.
>> 
>> Nicolas
>> 
> 
> My IVY file now looks like this (every module is asame, just change the name
> of module and artefacts)
> Here my module "win32registry" depends on my other module "exception".
> 
> 
> 
>> <ivy-module version="1.0">
>>    <info organisation="org.efe4it" module="efe4it-lib-win32registry"
>> revision="trunk"/>
>>    <configurations>
>>    	<conf name="main-compile" description="compilation of main source
>> tree"/>
>>    	<conf name="javadoc" description="documentation"/>
>>    	<conf name="test-compile" description="compilation of test source
>> tree"/>
>>    	<conf name="runtime" extends="main-compile" visibility="private"
>> description="run"/>
>>    	<conf name="test" extends="test-compile,runtime" visibility="private"
>> description="test"/>
>>    </configurations>
>>    <publications>
>>    	<artifact name="efe4it-lib-win32registry-main" type="jar" 
>> conf="main-compile" ext="jar"/> 
>> 	<artifact name="efe4it-lib-win32registry-javadoc" type="javadoc"
>> conf="javadoc" ext="zip"/>
>>    </publications>
>>    <dependencies>
>>        <dependency org="org.slf4j" name="slf4j" rev="1.5.8"
>> conf="main-compile,javadoc->core"/>
>>        <dependency org="org.slf4j" name="slf4j" rev="1.5.8"
>> conf="runtime->log4j"/>
>>        <dependency org="org.junit" name="junit" rev="4.5"
>> conf="test-compile,test->default"/>
>>        <dependency org="org.efe4it" name="efe4it-lib-exception"
>> rev="trunk" conf="main-compile->main-compile"/>
>>    </dependencies>
>> </ivy-module>
>> 
> 
> And ivy console verbose output is
> 
> 
>> IVYDE: calling resolve on ivy.xml
>> 
>> :: resolving dependencies :: org.efe4it#efe4it-lib-win32registry;trunk
>> 	confs: [main-compile, test, test-compile, runtime]
>> 	validate = true
>> 	refresh = false
>> resolving dependencies for configuration 'main-compile'
>> == resolving dependencies for org.efe4it#efe4it-lib-win32registry;trunk
>> [main-compile]
>> [...]
>> == resolving dependencies
>> org.efe4it#efe4it-lib-win32registry;trunk->org.efe4it#efe4it-lib-exception;trunk
>> [main-compile->main-compile]
>> efe4it-lib-win32registry-ivyde-workspace-chain-resolver: Checking cache
>> for: dependency: org.efe4it#efe4it-lib-exception;trunk
>> {main-compile=[main-compile]}
>> 	found org.efe4it#efe4it-lib-exception;trunk in
>> efe4it-lib-win32registry-ivyde-workspace-resolver
>> [...]
>> :: resolution report :: resolve 296ms :: artifacts dl 16ms
>> 	---------------------------------------------------------------------
>> 	|                  |            modules            ||   artifacts   |
>> 	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
>> 	---------------------------------------------------------------------
>> 	|   main-compile   |   2   |   1   |   1   |   0   ||   3   |   0   |
>> 	|       test       |   4   |   1   |   1   |   0   ||   9   |   0   |
>> 	|   test-compile   |   1   |   0   |   0   |   0   ||   3   |   0   |
>> 	|      runtime     |   3   |   1   |   1   |   0   ||   6   |   0   |
>> 	---------------------------------------------------------------------
>> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
>> WARN: 	::          UNRESOLVED DEPENDENCIES         ::
>> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
>> WARN: 	:: org.efe4it#efe4it-lib-exception;trunk: configuration not found
>> in org.efe4it#efe4it-lib-exception;trunk: 'main-compile'. It was required
>> from org.efe4it#efe4it-lib-win32registry;trunk main-compile
>> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
>> 
>> 
>> :: problems summary ::
>> :::: WARNINGS
>> 		::::::::::::::::::::::::::::::::::::::::::::::
>> 
>> 		::          UNRESOLVED DEPENDENCIES         ::
>> 
>> 		::::::::::::::::::::::::::::::::::::::::::::::
>> 
>> 		:: org.efe4it#efe4it-lib-exception;trunk: configuration not found in
>> org.efe4it#efe4it-lib-exception;trunk: 'main-compile'. It was required
>> from org.efe4it#efe4it-lib-win32registry;trunk main-compile
>> 
>> 		::::::::::::::::::::::::::::::::::::::::::::::
>> 
> 
> If I follow you, having IvyDE ignoring the publication section make
> module-exception "main" JAR not visible to module-win32registry.

Ivy doesn't build anything, so Ivy won't produce that "main" jar. It is ant which is doing that. In Eclipse, no jar is not build neither. The trick to make your project win32registry compile without having that "main" jar, is to make a dependency between the two projects. That is what IvyDE is doing with the workspace resolver.

So the resolve on win32registry is about:
* reading the ivy.xml of win32registry : Ivy finds a dependency on efe4it-lib-exception;trunk[main-compile]
* looking for efe4it-lib-exception;trunk[main-compile] in the repositories
* the first repository to look for is the workspace
* it should find the ivy.xml of the Java project efe4it-lib-exception and should see that the version match
* resolved finished it gather every artifacts and add them to the classpath. For the ivy.xml resolved via the workspace resolver, the artifact is an eclipse project.


> I'm afraid that would mean I need a distinct ivy file for Eclipse/IvyDE.
> 
> If you can spare some time, you may have a broader view of my setup here
> (from tomorrow on, some things are actually broken now that I will fix
> tonight):
> 
> 
>> svn checkout http://efe4it-suite.googlecode.com/svn/trunk/
>> efe4it-suite-read-only 
>> 

your ivy.xml files looks fine to me. I have been able to make a proper resolve in workspace (I removed every dependency and I used a default ivysettings). Try to clean your caches.
If you still have issues, their maybe an issue in your ivysettings, which is not on svn (yet ?).

Nicolas


Re: IvyDE Workspace Resolver

Posted by efe4it <ex...@sncf.fr>.

Nicolas Lalevée wrote:
> 
> About how the workspace resolver work, you have to understand that IvyDE
> is then trying to see the eclipse workspace as an Ivy repository. So the
> ivy.xml files in the Eclipse project must have enough information so that
> it really looks like a repository. The only difference should be about the
> artifacts. Since there is nothing actually published, IvyDE doesn't really
> care about the <publications> tag in the ivy.xml. But you should not
> reference any artifact in the dependencies section.
> 
> Nicolas
> 

My IVY file now looks like this (every module is asame, just change the name
of module and artefacts)
Here my module "win32registry" depends on my other module "exception".



> <ivy-module version="1.0">
>     <info organisation="org.efe4it" module="efe4it-lib-win32registry"
> revision="trunk"/>
>     <configurations>
>     	<conf name="main-compile" description="compilation of main source
> tree"/>
>     	<conf name="javadoc" description="documentation"/>
>     	<conf name="test-compile" description="compilation of test source
> tree"/>
>     	<conf name="runtime" extends="main-compile" visibility="private"
> description="run"/>
>     	<conf name="test" extends="test-compile,runtime" visibility="private"
> description="test"/>
>     </configurations>
>     <publications>
>     	<artifact name="efe4it-lib-win32registry-main" type="jar" 
> conf="main-compile" ext="jar"/> 
> 	<artifact name="efe4it-lib-win32registry-javadoc" type="javadoc"
> conf="javadoc" ext="zip"/>
>     </publications>
>     <dependencies>
>         <dependency org="org.slf4j" name="slf4j" rev="1.5.8"
> conf="main-compile,javadoc->core"/>
>         <dependency org="org.slf4j" name="slf4j" rev="1.5.8"
> conf="runtime->log4j"/>
>         <dependency org="org.junit" name="junit" rev="4.5"
> conf="test-compile,test->default"/>
>         <dependency org="org.efe4it" name="efe4it-lib-exception"
> rev="trunk" conf="main-compile->main-compile"/>
>     </dependencies>
> </ivy-module>
> 

And ivy console verbose output is


> IVYDE: calling resolve on ivy.xml
> 
> :: resolving dependencies :: org.efe4it#efe4it-lib-win32registry;trunk
> 	confs: [main-compile, test, test-compile, runtime]
> 	validate = true
> 	refresh = false
> resolving dependencies for configuration 'main-compile'
> == resolving dependencies for org.efe4it#efe4it-lib-win32registry;trunk
> [main-compile]
> [...]
> == resolving dependencies
> org.efe4it#efe4it-lib-win32registry;trunk->org.efe4it#efe4it-lib-exception;trunk
> [main-compile->main-compile]
> efe4it-lib-win32registry-ivyde-workspace-chain-resolver: Checking cache
> for: dependency: org.efe4it#efe4it-lib-exception;trunk
> {main-compile=[main-compile]}
> 	found org.efe4it#efe4it-lib-exception;trunk in
> efe4it-lib-win32registry-ivyde-workspace-resolver
> [...]
> :: resolution report :: resolve 296ms :: artifacts dl 16ms
> 	---------------------------------------------------------------------
> 	|                  |            modules            ||   artifacts   |
> 	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> 	---------------------------------------------------------------------
> 	|   main-compile   |   2   |   1   |   1   |   0   ||   3   |   0   |
> 	|       test       |   4   |   1   |   1   |   0   ||   9   |   0   |
> 	|   test-compile   |   1   |   0   |   0   |   0   ||   3   |   0   |
> 	|      runtime     |   3   |   1   |   1   |   0   ||   6   |   0   |
> 	---------------------------------------------------------------------
> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
> WARN: 	::          UNRESOLVED DEPENDENCIES         ::
> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
> WARN: 	:: org.efe4it#efe4it-lib-exception;trunk: configuration not found
> in org.efe4it#efe4it-lib-exception;trunk: 'main-compile'. It was required
> from org.efe4it#efe4it-lib-win32registry;trunk main-compile
> WARN: 	::::::::::::::::::::::::::::::::::::::::::::::
> 
> 
> :: problems summary ::
> :::: WARNINGS
> 		::::::::::::::::::::::::::::::::::::::::::::::
> 
> 		::          UNRESOLVED DEPENDENCIES         ::
> 
> 		::::::::::::::::::::::::::::::::::::::::::::::
> 
> 		:: org.efe4it#efe4it-lib-exception;trunk: configuration not found in
> org.efe4it#efe4it-lib-exception;trunk: 'main-compile'. It was required
> from org.efe4it#efe4it-lib-win32registry;trunk main-compile
> 
> 		::::::::::::::::::::::::::::::::::::::::::::::
> 

If I follow you, having IvyDE ignoring the publication section make
module-exception "main" JAR not visible to module-win32registry.

I'm afraid that would mean I need a distinct ivy file for Eclipse/IvyDE.

If you can spare some time, you may have a broader view of my setup here
(from tomorrow on, some things are actually broken now that I will fix
tonight):


> svn checkout http://efe4it-suite.googlecode.com/svn/trunk/
> efe4it-suite-read-only 
> 


Regards

Emmanuel

-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31799813.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: IvyDE Workspace Resolver

Posted by Nicolas Lalevée <ni...@hibnet.org>.
Le 6 juin 2011 à 16:53, efe4it a écrit :

> 
> Hi
> 
> Since my previous post, I added javadoc artefact publication, which works
> fine if calling ivy from ANT (after some tweaking of deliver/publish).
> 
> But now the WorkspaceResolver is lost again, and my only solution to stop it
> complaining is to disable version checking in the global IvyDE preferences. 
> However this is only a workaround.
> 
> Now I would like to debug IvyDE to understand what happen. 
> How do you setup Eclipse to debug the resolve step of IvyDE ?

The usual first step is to look into the Ivy Console:
http://ant.apache.org/ivy/ivyde/history/latest-milestone/console.html

About how the workspace resolver work, you have to understand that IvyDE is then trying to see the eclipse workspace as an Ivy repository. So the ivy.xml files in the Eclipse project must have enough information so that it really looks like a repository. The only difference should be about the artifacts. Since there is nothing actually published, IvyDE doesn't really care about the <publications> tag in the ivy.xml. But you should not reference any artifact in the dependencies section.

Nicolas


Re: IvyDE Workspace Resolver

Posted by efe4it <ex...@sncf.fr>.
Hi

Since my previous post, I added javadoc artefact publication, which works
fine if calling ivy from ANT (after some tweaking of deliver/publish).

But now the WorkspaceResolver is lost again, and my only solution to stop it
complaining is to disable version checking in the global IvyDE preferences. 
However this is only a workaround.

Now I would like to debug IvyDE to understand what happen. 
How do you setup Eclipse to debug the resolve step of IvyDE ?


Regards
 

-- 
View this message in context: http://old.nabble.com/IvyDE-Workspace-Resolver-tp31425340p31784151.html
Sent from the ivy-user mailing list archive at Nabble.com.