On 3/2/06, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> Hi Manfred!
> > Is there no easy way to add a jar as "Source" in eclipse?
> >
> It looks like this is not possible, at least I dont see how to do it.
> What will be possible is to add myfaces-shared-impl-2.0.0-SNAPSHOT.jar
> (the classes) to the classpath
> and attach myfaces-shared-impl-2.0.0-SNAPSHOT-sources.jar as source to it.

Yes, that's exactly what I do (ie. the new idea-plugin does) in IDEA.


> But this makes no difference to the way it is now. I konw IDEA, but what
> is different to attach the -source.jars instead of the directories?

The differences are:
1. Artifacts vs volatile dirs
 * the -source.jars are official build artifacts that are installed in
your local Maven repo whenever you do a "mvn install", whereas
 * the target dirs are volatile dirs, that vanish when you do a "mvn
clean" for instance

2. archived sources are read-only
 * sources in jars are read-only within the IDE
 * sources in target dirs (ie. directly on disk) are writeable which
is dangerous, because you should *never* change one of the shared_impl
or shared_tomahawk classes directly


> In either case, you will have multiple independent versions of these
> classes in your IDE.
> The problem is due to the different package names.

What do you mean by "independent"?
Original source is always the org.apache.myfaces.shared.* stuff. If
you change something there, you do a "mvn install" in shared project
and go back to your IDE. That's all.


> Sorry for being ignorant, but - could you please direct me to the post
> where I can read why this all was necessary?

http://www.nabble.com/Once-more%3A-Commons-refactoring-and-releasing-t1168916.html#a3069678
http://www.nabble.com/Commons-refactoring---reloaded-was%3A-Once-more%3A-Commons-refactoring-and-releasing--t1174987.html#a3116904


> My problem is, that I have to do something with the AddResource et al
> stuff. It is nearly impossible to refactor like the way it is now as the
> same AddResource is available in three packages and I have to change it
> in the package which is NOT used in any package.

Don't know what you mean by "package which is NOT used in any
package", but shared classes *must* always be changed in shared/core
module.


> On the other hand Martin told me that we have to move the tomahawk stuff
> out of shared-core and thus this limitation (at least for my current
> pain) will go away :-)

Yes, that's perhaps the key to your problem. AddResource is available
in impl and tomahawk, although it is (perhaps?) only needed in
tomahawk.

And this is the kind of issues that the new "shared" structure now
reveals. In the long run this new structure will bring us to a clearer
sparation and structure. The way may be painful in some points but I'm
sure it's worth the only single drawback we have now: We cannot do
IDE-supported refactoring of a shared class.


Manfred

Reply via email to