Hello,

Just thought I would chime in with a few thoughts on the POM and
maven-new.

The new artifact code is meant to allow the creation of any arbitrary
production from the listed dependencies in the POM. A production can be
a:

o classpath
o set of files
o set of properties

Basically, any arbitrary collection of values that can be contained
within a set of dependencies in a POM.

Now so far I have seen the notion of <type> and <kind> discussed.

Currently in maven-new the <type> element is specifically used to
determine which artifact handler an artifact is processed with. This is
not exactly what I had in mind and it's my fault for not explaining
myself clearly while Michal was doing some refactoring.

I believe that <type> and <kind> can be replaced with a single set of
hints. And here the hints are specifically artifact handler hints.

Say we have the following POM:

<pom>
  <dependencies>
    <dependency>
      <groupId></groupId>
      <artifactId></artifactId>
      <hints>
        <type>jar</type>
        <war>true</war>
      </hints>
    </dependency>
    <dependency>
      <groupId></groupId>
      <artifactId></artifactId>
      <hints>
        <type>jar</type>
        <war>true</war>
      </hints>
    </dependency>
    <dependency>
      <groupId></groupId>
      <artifactId></artifactId>
      <hints>
        <type>jar</type>
        <test>true</test>
      </hints>
    </dependency>
  </dependencies>
</pom>

So instead of an artifact being passed through only one artifact handler
it passes through a chain of artifact handlers and each artifact handler
does what it likes with the artifact based on hinting information.

So we may have some standard artifact handlers in the core, but I see
many of the artifact handlers coming from plugins themselves. When a
plugin is loaded the artifact handlers it provides are loaded into the
artifact handler chain. When it's finished they can be removed. So for
example with the WAR plugin it would have a simple artifact handler that
looked for 'war=true' hint and if found would add that artifact to a
production which was a list of artifacts you wanted packed into a WAR.

So I see the POM being able to store an arbitrary map of productions and
it would be up to the artifact handler to name the production. So when
the artifacts are processed any number of productions can be created and
stored in the POM. When a plugin is executed it has access to the POM
and can extract the productions it needs to carry out its task.

So this way everything is offloaded to the plugin. If the standard
productions don't suit the plugin then the plugin provides 1..n artifact
handlers to create the productions it needs. And the artifact handler is
simply triggered by the hinting information.

The <hints> could also be <properties>, I don't really care. I'm just
trying to stress that a single set of hints or properties would do the
trick as all we are really trying to do is provide some arbitrary set of
information to a plugin and I believe this will work.

We could also use the hinting information to access the artifact type
directory or anything else that would be required in the artifact
processing chain.

I will actually send another message about transitive dependencies to
keep the ideas separated.

-- 
jvz.

Jason van Zyl
[EMAIL PROTECTED]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to