You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "michal.maczka" <mi...@cqs.ch> on 2003/04/22 13:13:58 UTC

New Maven - artifact, dependency, repository layout - what are the responsibilities of those classes

Hi everyone!

I am implementing the new artifact handling mechanism.
And I have a bunch of questions:

It will be great to have fully clarified the roles, responsibilities of
following entities: artifact, dependency, repository layout


What's the purpose of Repository Layout class?
Should this class be used to build a path for given artifact?
and is it meant to be consulted every time when path in repository for
artifact is resolved?
So basically artifact is just providing meta information which is used for
constructing the path
or artifact should contain also a path.

Splitting of this responsibilities will provide extra complexivity but will
also
give better flexibility.
So just want to know what are the plans related to this class and how do you
describe
the responsibility of




I have make some preliminary basic design based on following design goals:

0) I wanted to be 100 % compatible with old version
1) Artifact should become independent from dependency
   There are two motives for this:
   a) I can imagine that artifact can be created at the runtime by plugins
     (e.g. through resolving the group dependency)

   b) I believe that only Artifact list should be used/visible for plugins.
The list of dependences should
     be rather used internal, not by plugins.
     If you consider the point "a" above as valid scenario,
     it becomes a must for artifact to be equipped with some additional
      information like: id, group id, type etc.
3) There is  to one mapping between artifacts and dependencies. But if this
    assumption is going to change it should be transparent to the other
parts of Maven
   (that's why Artifact Factory interface looks like it looks and is very
different from old interface)

To achieve all above goals I have to "duplicate" in artifact some
information kept in dependency
Moreover artifact has been equipped with additional set of fields
Some of then are rather necessary
(like flag indicating if artifact should be added to dependency classpath)
some others are just additions which will let to track the artifact life
cycle
(e.g. the fields indicating if artifact has be overridden version,
overridden file)

I have marked the interface of Artifact Factory and
provide default implementation which I guess should be 100% compatible with
old version(Jar OVERRIDE
mechanism is now in this class)

I am already pretty much advanced with another implementation of this
interface
which is much more smarter and configurable through config file (based on
"my old" concept of Type Descriptor).
Thanks to "component" approach applied in Avalon the switch to this new
implementation should be "invisible".
This new implementation will also be fully compatible with Plexus API.


<Off topic>
I think that Repository Layout can be also used to replace "jar override"
mechanism (exclude version) .
Once the repository layout can assigned to given repository we can imagine
the
repository with flat hierarchy like:
lib /
     a-1.0.jar
     b-1.0.jar


etc even kept in project
I think that this will be a bit cleaner and much simpler then the way it is
now.
There is a lot of projects which store all required libraries in CVS
and for such projects he switch can be even simpler
(specially if there will be plugin which will index such repository and
produce
<dependency> section automatically.
Even if Maven promotes some practices.. it should enable step by step switch
to "better world"
for project which are not yet mavenized.


But please forget about this idea now...

</Off topic>


What I am sending is not yet tested. Rather I want to consult a "concept"
and I am ready for your critics and once I will get your feedback I can
continue.
But to make the things correcly I to know exactly what roles/usage scenarios
are you seeing for artifact, dependency etc.
Are those roles similar to the those which I have assigned?

I should definitely have more time this week to work on this ...


regards

Michal