People have complained about this for a long time.

I may be biased but in my opinion this is clearly an IvyDE problem: IvyDE
should be associating sources to JARs using ivy configurations, not
filenames. In fact, ivy does not define filenames, the user of ivy does
(see this 
discussion<http://code.google.com/p/ivyroundup/wiki/HowToConfigureIvy#Retrieval_Patterns>).
In this case, that user is IvyDE.

But even doing that is not necessary. Here is a very simple approach for
IvyDE to take: for a given ivy module, download all the artifacts of type
"source". Then when a user clicks to "view source" on a Java class name,
search all these source artifacts for the first one containing the
corresponding java file and display it. Why is this so hard?

Instead, they have hard-coded assumptions which are brittle and won't ever
work for all ivy modules anyway, e.g., those that don't have a 1:1 JAR to
source ZIP correspondence.

-Archie

On Fri, Feb 24, 2012 at 3:30 PM, Alan Chaney <a...@mechnicality.com> wrote:

> Hi Everybody
>
> For a long while I've been rather frustrated with the "the jar of this
> class file belongs to ivy.xml" message that pops up in eclipse with certain
> projects. I searched for other messages on this subject but found nothing
> conclusive.
>
> I'm using eclipse indigo and helios, both with ivy 2.2 and ivyde 2.1.
>
> Generally, it works really well, but I've been hitting the above problem,
> so I had a look into it and found the following:
>
> 1. The files that were giving a problem where ones with the following in
> the ivy.xml:
>
> <publications>
> <artifact/>
> <artifact name="source" type="source" ext="zip"/>
> </publications>
>
> what this says to Ivy, or so I understand, is publish the jar in a folder
> called jar with the name  [project]-[revision].jar  and publish the source
> in a folder called sources with the name source-[revision].zip.
>
> I was experimenting with javax.transaction (jta) so my jar path was:
> jta/jar/jta-1.1.jar and my source path was jta/sources/source-1.1.zip
>
> It seems that there is no 'sources' pattern that I can find that matches
> sources/source.zip. If you double-click on a class name in the eclipse
> browser, you get the dreaded 'jar of class... " message and a disassembly
> of the java.
>
>
> I found that if I edited the <publications> element as:
>
> <publications>
> <artifact/>
> <artifact type="source" ext="zip"/>
> </publications>
>
> and renamed my source file in the cache as [project]-[revision].zip (in my
> example above to jta-1.1.zip) then, magically, it all worked!
>
> Sadly, the pattern name="source" type="source" extn="zip" appears to be
> widely used in ivy-roundup.
>
> So it seems to me that there are three solutions to this problem:
>
> 1. Tell me what pattern to use in the Advanced--sources field of ivyde to
> resolve patterns of the form source-[revision].zip
>
> 2. Fix ivyde so that it will match source-[revision].zip
>
> 3. modify ivy-roundup by removing name="source" or changing it to name the
> sources as the project name, e.g in my example name="jta"
>
> I'm partly doing this because other people I work with are moaning about
> how Ivy is not allowing them to see the sources of the files they download,
> and the only other fix is for me to build a corporate repository.
>
> Does anyone have any other thoughts?
>
> Thanks
>
> Alan
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


-- 
Archie L. Cobbs

Reply via email to