You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/11/11 13:19:39 UTC

[Proposal] Project deliverables definition in POM

Hi,

Shouldn't we define project deliverables in the POM? I think this could
be very useful. Let me give some potential usages:

- ability to automatically say "build me this project", whether the
project generates a war, an ejb, an ear, a jar, a plugin jar, etc. ATM,
there is no way to recognize a project's type.

- ability to develop maven plugins that uses deliverable information.
For example the maven site plugin could automatically generate download
links pointing to the project's deliverables. The multichanges plugin
could provide links for the latest releases, etc.

Here's how it could be defined in the POM:

Example for a plugin project:
-----------------------------

<deliverables>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact>
    <type>plugin</type>
  </deliverable>
</deliverables>

Note 1: <groupId> is already defined at the global level and this is
fine.
Note 2: <id> should be removed. Indeed, it is not enough as there are
possibly several deliverables per project (for example a typical jar
project will deliver: a jar, a zipped javadoc, a source distribution, a
website zip, etc.
Note 3: We would of course only deprecate the <id> tag to preserve
compatibility. It would be equivalent to saying:

<deliverables>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact>
    <type>jar</type>
  </deliverable>
</deliverables>

Example for a standard jar project:
-----------------------------------

<deliverables>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact>
    <type>jar</type>
  </deliverable>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact>
    <type>javadoc</type>
  </deliverable>
</deliverables>

etc.

Summary: I believe the existing mechanism (i.e. global <groupId>, <id> -
BTW, there is no global <type>) is too limitative and that it is
preventing us from providing further added value for projects. The
proposal above suggest a mechanism for extending it to support several
deliverables.

Comments? (I'm sure there'll be plenty ;-)).

-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Rafal Krzewski <Ra...@caltha.pl>.
Vincent Massol wrote:
> I would be -1 to change the standard naming of
> <name>-<version>.<extension>.

I think its a minor change if you look at it in the following way:

<name>-<version><extension>

old extensions: .jar .zip .war ...
new extensions: .jar -debug.jar -source.zip ...


> Could you explain why you think it doesn't belong to the POM?

I have no strong opinion on that. Putting in into properties seemed
natural, by analogy to multiproject. Besides the current policy of
attribute-less XML in the pom makes it look sooo awkward...

<deliverables>
  <deliverable>jar</deliverable>
  <deliverable>source</deliverable>
  <deliverable>javadoc</deliverable>
  <main-deliverable>jar</main-deliverable>
</deliverables>

vs.

<deliverables>
  <deliverable type="jar" main="true"/>
  <deliverable type="source"/>
  <deliverable type="javadoc"/>
</deliverables>

> If it's not put in the POM (i.e. if we use properties), who will be the
> owner of them? driver.properties (i.e the core)? Or some other plugins
> (a deliverable plugin, the release plugin, etc)?

A plugin I think, not sure about the naming though. I imagine we could
reach a point where most things could be achieved with the following goals:

install
install-all
deploy
deploy-all

R.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Jason van Zyl <jv...@maven.org>.
On Wed, 2003-11-12 at 11:35, Kurt Schrader wrote:
> On Nov 12, 2003, at 10:29 AM, Jason van Zyl wrote:
> 
> > I honestly do not like a <deliverables/> because it distinctly clashes
> > with a central notion of one artifact per project. Yes, in reality more
> > are produced but maybe this is an indication that projects need to be
> > separated further i.e. a small project for creating distributions and a
> > small project for creating various documentation artifacts.
> 
> I agree with you in general that there should only be one deliverable
> per project, but I think that we need to address things like how to
> deliver a src distribution and/or a debug enabled distribution of the
> same artifact.  

Right, there is definitely the primary thing being produced but you
certainly have everything else.

> Maven currently doesn't handle different permutations
> of an artifact well, and I think that this would be helpful in those
> instances.

Yah, I think we will get somewhere with this discussion. I hope
something falls out because people are definitely generating other
things and it would be useful to capture what people are doing and try
to provide a standard way of doing it.

> -Kurt
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Kurt Schrader <ks...@karmalab.org>.
On Nov 12, 2003, at 10:29 AM, Jason van Zyl wrote:

> I honestly do not like a <deliverables/> because it distinctly clashes
> with a central notion of one artifact per project. Yes, in reality more
> are produced but maybe this is an indication that projects need to be
> separated further i.e. a small project for creating distributions and a
> small project for creating various documentation artifacts.

I agree with you in general that there should only be one deliverable
per project, but I think that we need to address things like how to
deliver a src distribution and/or a debug enabled distribution of the
same artifact.  Maven currently doesn't handle different permutations
of an artifact well, and I think that this would be helpful in those
instances.

-Kurt


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Jason van Zyl wrote:
...
> I would just like to avoid the complete arbitrary nature of the gump
> descriptor when it comes things that are generated from a project.

In Centipede we use the Gump descriptor for the artifacts, and we
had the same need of having to extend it to specify the artifact type.

Hence I agree with this. From the Gump perspective having arbitrary
artifacts is ok, but for systems that automate things it's vitally
important that artifact types are clearly defined.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Jason van Zyl <jv...@maven.org>.
On Wed, 2003-11-12 at 11:26, Vincent Massol wrote:
> At least we have an agreement on adding a <type> element. That's a good
> first step! :-)
> 
> Hmm... If I understand correctly what you are saying about deliverables,
> there should be one project.xml for each deliverable. That means that
> all of these project.xml (for each deliverable) could/should actually
> live in the same directory location (as they are operating on the same
> sources for most of them).
> 
> project-jar.xml
> project-javadoc.xml
> project-src.xml
> 
> Is that what you mean?

I'm not sure how to categorize it is really the difficult part for me.
Primarily I am building a JAR which I consider the primary artifact but
of course you have the supporting artifacts like docs and such.

> But then, isn't this the same as saying
> 
> <project>
>   <deliverable>jar</deliverable>
>   <deliverable>jar</deliverable>
>   <deliverable>jar</deliverable>
> </project>
> 
> or
> 
> <solution>
>   <deliverable>project-jar.xml</deliverable>
>   <deliverable>project-javadoc.xml</deliverable>
>   <deliverable>project-src.xml</deliverable>
> </solution> if you prefer.
> 
> That said I find this a bit heavy to write as all project-*.xml will
> share 99% of their content. So in practice you'll need:
> 
> project-common.xml (extending some higher level project-common.xml)
> project-jar.xml (extending project-common.xml)
> project-javadoc.xml ""
> project-src.xml ""
> 
> I definitely think this is too heavy.

Yah I agree. I certainly wouldn't want to get into that. It's highly
inconvenient and irritating.

> We already have 2 levels: a global project is made of several
> subprojects. What you are saying (if I understood correctly, probably
> not ;-)) is that subproject is made of several "deliverable projects".

Basically, yes. But I certainly don't want to get into a POM orgy in
order to make a JAR along with some docs and the distribution.

But there is a distinct difference between say the JAR and a javadocs
bundle simple for the fact that one can exist without the other but not
vice versa. I don't know maybe a distinction between the primary
artifact and support artifacts.

I would just like to avoid the complete arbitrary nature of the gump
descriptor when it comes things that are generated from a project.

> Hmmm....
> 
> -- 
> jvz.
> 
> Jason van Zyl
> jason@zenplex.com
> 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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Vincent Massol <vm...@pivolis.com>.
At least we have an agreement on adding a <type> element. That's a good
first step! :-)

Hmm... If I understand correctly what you are saying about deliverables,
there should be one project.xml for each deliverable. That means that
all of these project.xml (for each deliverable) could/should actually
live in the same directory location (as they are operating on the same
sources for most of them).

project-jar.xml
project-javadoc.xml
project-src.xml

Is that what you mean?

But then, isn't this the same as saying

<project>
  <deliverable>jar</deliverable>
  <deliverable>jar</deliverable>
  <deliverable>jar</deliverable>
</project>

or

<solution>
  <deliverable>project-jar.xml</deliverable>
  <deliverable>project-javadoc.xml</deliverable>
  <deliverable>project-src.xml</deliverable>
</solution> if you prefer.

That said I find this a bit heavy to write as all project-*.xml will
share 99% of their content. So in practice you'll need:

project-common.xml (extending some higher level project-common.xml)
project-jar.xml (extending project-common.xml)
project-javadoc.xml ""
project-src.xml ""

I definitely think this is too heavy.

We already have 2 levels: a global project is made of several
subprojects. What you are saying (if I understood correctly, probably
not ;-)) is that subproject is made of several "deliverable projects".

Hmmm....

-Vincent


> -----Original Message-----
> From: Jason van Zyl [mailto:jvanzyl@maven.org]
> Sent: 12 November 2003 16:30
> To: Maven Developers List
> Subject: RE: [Proposal] Project deliverables definition in POM
> 
> On Wed, 2003-11-12 at 09:14, Vincent Massol wrote:
> 
> > I would view deliverables as core information and hence put it in
the
> > POM/core driver properties.
> 
> In the past we have tried to align the top-level POM fields with
> dependencies so that there was a mesh for example we have:
> 
> <project>
>   <groupId>foo</groupId>
>   <artifactId>bar</artifactId>
>   ...
> </project>
> 
> Now lets take that a step further ...
> 
> > Don't you think defining a project's deliverables belong to the
> > "standardized" property set? Isn't that a major structural
information
> > for a project?
> 
> Yes, but I am still of the mind that a project produces one artifact.
> I'll call it the primary artifact for lack of a better word because
> there are always docs and distributions and whatever else. But adding
a
> type to the top-level:
> 
> <project>
>   <groupId>foo</groupId>
>   <artifactId>bar</artifactId>
>   <type>
> </project>
> 
> Then this meshes an actual project more completely with the dependency
> elements.
> 
> > A project requires several information:
> > 1- what dependencies it has on others
> > 2- what it generates
> 
> To me given a type at the top-level would indicate what we are
> generating.
> 
> I honestly do not like a <deliverables/> because it distinctly clashes
> with a central notion of one artifact per project. Yes, in reality
more
> are produced but maybe this is an indication that projects need to be
> separated further i.e. a small project for creating distributions and
a
> small project for creating various documentation artifacts.
> 
> > 3- how to generate the distributables
> >
> > Number 2 is what we are discussing. Actually if you look at Gump's
> > descriptors you'll find they have this information as it is required
is
> > you start managing several projects: the output from one project is
the
> > input from another project. It's also useful to verify if a full
project
> > build has been successful (i.e. if the distributables have all been
> > generated).
> 
> I think we could do that by adding a <type/> to the top-level and
think
> harder about how we work with projects on a daily basis.
> 
> I often assume the output of one project and use it for the input to
> another all the time. I guess typically I assume the default jar type
> and I have my projects organized in such a way as I know where they
are
> deposited.
> 
> I'm am not keen on a <deliverables/> element as I think allowing an
> arbitrary number of deliverables versus forcing the thought of how to
> decompose projects so that there is one artifact per project will lead
> to problems down the line.
> 
> > Thanks
> > -Vincent
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> --
> jvz.
> 
> Jason van Zyl
> jason@zenplex.com
> 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: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Jason van Zyl <jv...@maven.org>.
On Wed, 2003-11-12 at 09:14, Vincent Massol wrote:

> I would view deliverables as core information and hence put it in the
> POM/core driver properties.

In the past we have tried to align the top-level POM fields with
dependencies so that there was a mesh for example we have:

<project>
  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  ...
</project>

Now lets take that a step further ...

> Don't you think defining a project's deliverables belong to the
> "standardized" property set? Isn't that a major structural information
> for a project?

Yes, but I am still of the mind that a project produces one artifact.
I'll call it the primary artifact for lack of a better word because
there are always docs and distributions and whatever else. But adding a
type to the top-level:

<project>
  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  <type>
</project>

Then this meshes an actual project more completely with the dependency
elements.

> A project requires several information:
> 1- what dependencies it has on others
> 2- what it generates

To me given a type at the top-level would indicate what we are
generating. 

I honestly do not like a <deliverables/> because it distinctly clashes
with a central notion of one artifact per project. Yes, in reality more
are produced but maybe this is an indication that projects need to be
separated further i.e. a small project for creating distributions and a
small project for creating various documentation artifacts.

> 3- how to generate the distributables
> 
> Number 2 is what we are discussing. Actually if you look at Gump's
> descriptors you'll find they have this information as it is required is
> you start managing several projects: the output from one project is the
> input from another project. It's also useful to verify if a full project
> build has been successful (i.e. if the distributables have all been
> generated).

I think we could do that by adding a <type/> to the top-level and think
harder about how we work with projects on a daily basis. 

I often assume the output of one project and use it for the input to
another all the time. I guess typically I assume the default jar type
and I have my projects organized in such a way as I know where they are
deposited.

I'm am not keen on a <deliverables/> element as I think allowing an
arbitrary number of deliverables versus forcing the thought of how to
decompose projects so that there is one artifact per project will lead
to problems down the line.

> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
-- 
jvz.

Jason van Zyl
jason@zenplex.com
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Vincent Massol <vm...@pivolis.com>.
General comment:

The definition that I had in my head was that parameters that were
common to all plugins/projects were defined in the POM (project.xml) and
parameters that belonged to specific plugins were put in properties in
that plugin. Some would argue that what is in the POM is structural to
all projects. 

However, in practice none of these definitions are really applied. Also,
the fact that we have a mix of XML definition + properties is not very
consistent or convincing. In several other emails in the past I have
proposed to put *all* properties in the POM, by having an extension
mechanism that plugins would use but this has never been quite fully
agreed.

See below for specific comments...


> -----Original Message-----
> From: Michal Maczka [mailto:mmaczka@interia.pl]
> Sent: 12 November 2003 13:05
> To: Maven Developers List
> Subject: RE: [Proposal] Project deliverables definition in POM
> 
> 
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@pivolis.com]
> > Sent: Wednesday, November 12, 2003 12:28 PM
> > To: 'Maven Developers List'
> > Subject: RE: [Proposal] Project deliverables definition in POM
> >
> >
> > I would be -1 to change the standard naming of
> > <name>-<version>.<extension>.
> >
> 
> The problem is that there is no standard naming convention yet which
deals
> with artifacts like:
> 
> > > <artifactId>-<version>.jar
> > > <artifactId>-src-<version>.zip
> > > <artifactId>-javadoc-<version>.zip
> 
> 
> The standard convention is that every artifacts is describable by
POM's
> dependency element.
> It means that we have four attributes to our disposition {groupId,
> artifactId, version, type}
> and artifact location in the repository  (layout)  is a simple
function of
> those four attributes (with exception to artifacts of type "ejb")

and plugins, and ear (not sure for this one, would need to check).

> 
> This is purely technical limitation of our implementation.
> 
> For me the most natural way will be to have possibility to assign a
> function
> which computes the layout per each artifact type separately.
> 
> so you can e.g. specify that  layout of "javadoc"
> is=${groupId}//javadocs/${artifactId}-javadoc-${version}.jar

yep, that would be nice.

> 
> 
> 
> > Could you explain why you think it doesn't belong to the POM?
> >
> > If it's not put in the POM (i.e. if we use properties), who will be
the
> > owner of them? driver.properties (i.e the core)? Or some other
plugins
> > (a deliverable plugin, the release plugin, etc)?
> >
> 
> In other thread I also asked about this (Re: cvs commit:
> maven-plugins/multichanges/src/plugin-resources releases.jsl):
> "The fundamental question is: shall we use properties which belong
> to no plugin and what kind of problems they can cause?"
> 
> 
> POM can be also seen as conglomerate of project.xml + and properties
> files.
> As we have methods like project.getProperties()
> 
> So it's like we have first class (standardized) and second class
> properties
> (not standardized).

I kinda agree with this. 

> In fact ownership of properties is needed purely for setting default
> values.

It's also important when you separate plugins (which we are doing). So
you cannot assume all plugins will be loaded in a given maven
installation. Hence the reason there needs to be "core" properties/POM
(and for me, everything core should go in project.xml - the only problem
is deciding what is core...).

> 
> At the moment I don't have a good answer to the question "who will be
the
> owner of them?"
> I think that probably plugins should.

I would view deliverables as core information and hence put it in the
POM/core driver properties.

Don't you think defining a project's deliverables belong to the
"standardized" property set? Isn't that a major structural information
for a project?

A project requires several information:
1- what dependencies it has on others
2- what it generates
3- how to generate the distributables

Number 2 is what we are discussing. Actually if you look at Gump's
descriptors you'll find they have this information as it is required is
you start managing several projects: the output from one project is the
input from another project. It's also useful to verify if a full project
build has been successful (i.e. if the distributables have all been
generated).

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Michal Maczka <mm...@interia.pl>.

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: Wednesday, November 12, 2003 12:28 PM
> To: 'Maven Developers List'
> Subject: RE: [Proposal] Project deliverables definition in POM
>
>
> I would be -1 to change the standard naming of
> <name>-<version>.<extension>.
>

The problem is that there is no standard naming convention yet which deals
with artifacts like:

> > <artifactId>-<version>.jar
> > <artifactId>-src-<version>.zip
> > <artifactId>-javadoc-<version>.zip


The standard convention is that every artifacts is describable by POM's
dependency element.
It means that we have four attributes to our disposition {groupId,
artifactId, version, type}
and artifact location in the repository  (layout)  is a simple function of
those four attributes (with exception to artifacts of type "ejb")

This is purely technical limitation of our implementation.

For me the most natural way will be to have possibility to assign a function
which computes the layout per each artifact type separately.

so you can e.g. specify that  layout of "javadoc"
is=${groupId}//javadocs/${artifactId}-javadoc-${version}.jar



> Could you explain why you think it doesn't belong to the POM?
>
> If it's not put in the POM (i.e. if we use properties), who will be the
> owner of them? driver.properties (i.e the core)? Or some other plugins
> (a deliverable plugin, the release plugin, etc)?
>

In other thread I also asked about this (Re: cvs commit:
maven-plugins/multichanges/src/plugin-resources releases.jsl):
"The fundamental question is: shall we use properties which belong
to no plugin and what kind of problems they can cause?"


POM can be also seen as conglomerate of project.xml + and properties files.
As we have methods like project.getProperties()

So it's like we have first class (standardized) and second class properties
(not standardized).
In fact ownership of properties is needed purely for setting default values.

At the moment I don't have a good answer to the question "who will be the
owner of them?"
I think that probably plugins should.

Michal



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Vincent Massol <vm...@pivolis.com>.
I would be -1 to change the standard naming of
<name>-<version>.<extension>.

Could you explain why you think it doesn't belong to the POM?

If it's not put in the POM (i.e. if we use properties), who will be the
owner of them? driver.properties (i.e the core)? Or some other plugins
(a deliverable plugin, the release plugin, etc)?

Thanks
-Vincent

> -----Original Message-----
> From: Rafal Krzewski [mailto:Rafal.Krzewski@caltha.pl]
> Sent: 12 November 2003 11:43
> To: Maven Developers List
> Subject: Re: [Proposal] Project deliverables definition in POM
> 
> Vincent Massol wrote:
> 
> > <artifactId>-<version>.jar
> > <artifactId>-src-<version>.zip
> > <artifactId>-javadoc-<version>.zip
> > etc
> >
> > We *could* standardize on artifact names of course. The <artifactId>
> > could be optional and default to ${pom.artifactId}:
> 
> tweaking the above a bit:
> 
> <artifactId>-<version>.jar
> <artifactId>-<version>-src.zip
> <artifactId>-<version>-javadoc.zip
> 
> or as recently advertised:
> 
> <artifactId>-<version>-debug.jar
> <artifactId>-<version>-debug-src.jar
> 
> Such 'extended file extensions' would simplify name building in
plugins.
> 
> BTW. I really like the idea of having the following:
> 
> maven.deliverable.main=jar
> maven.deliverable.all=jar,source,javadoc
> 
> Will definetely help organize things.
> 
> R.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Rafal Krzewski <Ra...@caltha.pl>.
Vincent Massol wrote:

> <artifactId>-<version>.jar
> <artifactId>-src-<version>.zip
> <artifactId>-javadoc-<version>.zip
> etc
> 
> We *could* standardize on artifact names of course. The <artifactId>
> could be optional and default to ${pom.artifactId}:

tweaking the above a bit:

<artifactId>-<version>.jar
<artifactId>-<version>-src.zip
<artifactId>-<version>-javadoc.zip

or as recently advertised:

<artifactId>-<version>-debug.jar
<artifactId>-<version>-debug-src.jar

Such 'extended file extensions' would simplify name building in plugins.

BTW. I really like the idea of having the following:

maven.deliverable.main=jar
maven.deliverable.all=jar,source,javadoc

Will definetely help organize things.

R.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Michal Maczka [mailto:mmaczka@interia.pl]
> Sent: 11 November 2003 20:39
> To: Maven Developers List
> Subject: RE: [Proposal] Project deliverables definition in POM
> 
> 
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@pivolis.com]
> > Sent: Tuesday, November 11, 2003 6:50 PM
> > To: 'Maven Developers List'
> > Subject: RE: [Proposal] Project deliverables definition in POM
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Michal Maczka [mailto:mmaczka@interia.pl]
> > > Sent: 11 November 2003 14:21
> > > To: Maven Developers List
> > > Subject: Re: [Proposal] Project deliverables definition in POM
> > >
> > > Vincent Massol wrote:
> 
> > >
> > > Why type is not sufficient?
> >
> > Adding a type would be a good first step. But a project does not
have a
> > single deliverable.
> >
> 
> Sorry but  I don't understand:
> Aren't artifactId and groupId always the same for all deliverables ?
> (please forget about the fact that maven artifact resolving mechanism
> cannot
> handle this )

Close but not quite I think. For example:

<artifactId>-<version>.jar
<artifactId>-src-<version>.zip
<artifactId>-javadoc-<version>.zip
etc

We *could* standardize on artifact names of course. The <artifactId>
could be optional and default to ${pom.artifactId}:

<deliverables>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact> (optional)
    <type>plugin</type>
  </deliverable>
</deliverables>

Also, if there is no <deliverables> section, the following will be
loaded in the Project object:

<deliverables>
  <deliverable>
    <artifactId>${pom.artifactId}</artifact> (optional)
    <type>jar</type>
  </deliverable>
</deliverables>

That said, and for now, we could simply add a <type> element to the POM.
That would represent the main deliverable of the project.

Thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Michal Maczka <mm...@interia.pl>.

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: Tuesday, November 11, 2003 6:50 PM
> To: 'Maven Developers List'
> Subject: RE: [Proposal] Project deliverables definition in POM
>
>
>
>
> > -----Original Message-----
> > From: Michal Maczka [mailto:mmaczka@interia.pl]
> > Sent: 11 November 2003 14:21
> > To: Maven Developers List
> > Subject: Re: [Proposal] Project deliverables definition in POM
> >
> > Vincent Massol wrote:

> >
> > Why type is not sufficient?
>
> Adding a type would be a good first step. But a project does not have a
> single deliverable.
>

Sorry but  I don't understand:
Aren't artifactId and groupId always the same for all deliverables ?
(please forget about the fact that maven artifact resolving mechanism cannot
handle this )

Michal



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


RE: [Proposal] Project deliverables definition in POM

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Michal Maczka [mailto:mmaczka@interia.pl]
> Sent: 11 November 2003 14:21
> To: Maven Developers List
> Subject: Re: [Proposal] Project deliverables definition in POM
> 
> Vincent Massol wrote:
> 
> >Hi,
> >
> >Shouldn't we define project deliverables in the POM? I think this
could
> >be very useful. Let me give some potential usages:
> >
> >- ability to automatically say "build me this project", whether the
> >project generates a war, an ejb, an ear, a jar, a plugin jar, etc.
ATM,
> >there is no way to recognize a project's type.
> >
> >- ability to develop maven plugins that uses deliverable information.
> >For example the maven site plugin could automatically generate
download
> >links pointing to the project's deliverables. The multichanges plugin
> >could provide links for the latest releases, etc.
> >
> >Here's how it could be defined in the POM:
> >
> >Example for a plugin project:
> >-----------------------------
> >
> ><deliverables>
> >  <deliverable>
> >    <artifactId>${pom.artifactId}</artifact>
> >    <type>plugin</type>
> >  </deliverable>
> ></deliverables>
> >
> >Note 1: <groupId> is already defined at the global level and this is
> >fine.
> >Note 2: <id> should be removed. Indeed, it is not enough as there are
> >possibly several deliverables per project (for example a typical jar
> >project will deliver: a jar, a zipped javadoc, a source distribution,
a
> >website zip, etc.
> >Note 3: We would of course only deprecate the <id> tag to preserve
> >compatibility. It would be equivalent to saying:
> >
> ><deliverables>
> >  <deliverable>
> >    <artifactId>${pom.artifactId}</artifact>
> >    <type>jar</type>
> >  </deliverable>
> ></deliverables>
> >
> >Example for a standard jar project:
> >-----------------------------------
> >
> ><deliverables>
> >  <deliverable>
> >    <artifactId>${pom.artifactId}</artifact>
> >    <type>jar</type>
> >  </deliverable>
> >  <deliverable>
> >    <artifactId>${pom.artifactId}</artifact>
> >    <type>javadoc</type>
> >  </deliverable>
> ></deliverables>
> >
> >
> >
> 
> Why type is not sufficient?

Adding a type would be a good first step. But a project does not have a
single deliverable.

> 
> >etc.
> >
> >Summary: I believe the existing mechanism (i.e. global <groupId>,
<id> -
> >BTW, there is no global <type>) is too limitative and that it is
> >preventing us from providing further added value for projects. The
> >proposal above suggest a mechanism for extending it to support
several
> >deliverables.
> >
> >Comments? (I'm sure there'll be plenty ;-)).
> >
> >
> >
> Some times ago I was thinking about doing this via plugin.
> 
> Say we have "foo" plugin (no nice name is coming to my minds at the
> moment)
> 
> with goals
> 
> foo:install
> foo:install-snapshot
> foo:deploy
> foo:deploy-snapshot
> 
> 
> foo:all-install
> foo:all-install-snapshot
> foo:all-deploy
> foo:all-deploy-snapshot
> 
> and then properties like
> 
> maven.foo.main=jar
> maven.foo.all=jar, javadoc,  javasources,
> 
> 
> 
> 
> For example Implementation of foo:all-install can look like
> 
> foreach type in  {maven.foo.all} do
>    <attainGoal name="{$type}:install"/>
> end
> 
> 
> Then this plugin can be used by multiproject  plugin (in
> multiproject:install, multiproject:deploy etc) andfor creation of
pages
> with download information
> 
> I knew some reason why such functionality should not be based on
> informaton which is kept in POM (<deliverables>)
> (I have to refresh my memory and recall them...)

Everything can be done with plugins, even what is defined in the POM.
But for me the goal of the POM is to regroup all structural information
about the project and I believe deliverables is one of those.

Anyway, I'd like to see what others think. This could be added to the
POM without breaking anything.

BTW, I also think that the <build> elements should not be in the POM...
:-)

-Vincent

> 
> 
> 
> 
> Michal
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: [Proposal] Project deliverables definition in POM

Posted by Michal Maczka <mm...@interia.pl>.
Vincent Massol wrote:

>Hi,
>
>Shouldn't we define project deliverables in the POM? I think this could
>be very useful. Let me give some potential usages:
>
>- ability to automatically say "build me this project", whether the
>project generates a war, an ejb, an ear, a jar, a plugin jar, etc. ATM,
>there is no way to recognize a project's type.
>
>- ability to develop maven plugins that uses deliverable information.
>For example the maven site plugin could automatically generate download
>links pointing to the project's deliverables. The multichanges plugin
>could provide links for the latest releases, etc.
>
>Here's how it could be defined in the POM:
>
>Example for a plugin project:
>-----------------------------
>
><deliverables>
>  <deliverable>
>    <artifactId>${pom.artifactId}</artifact>
>    <type>plugin</type>
>  </deliverable>
></deliverables>
>
>Note 1: <groupId> is already defined at the global level and this is
>fine.
>Note 2: <id> should be removed. Indeed, it is not enough as there are
>possibly several deliverables per project (for example a typical jar
>project will deliver: a jar, a zipped javadoc, a source distribution, a
>website zip, etc.
>Note 3: We would of course only deprecate the <id> tag to preserve
>compatibility. It would be equivalent to saying:
>
><deliverables>
>  <deliverable>
>    <artifactId>${pom.artifactId}</artifact>
>    <type>jar</type>
>  </deliverable>
></deliverables>
>
>Example for a standard jar project:
>-----------------------------------
>
><deliverables>
>  <deliverable>
>    <artifactId>${pom.artifactId}</artifact>
>    <type>jar</type>
>  </deliverable>
>  <deliverable>
>    <artifactId>${pom.artifactId}</artifact>
>    <type>javadoc</type>
>  </deliverable>
></deliverables>
>
>  
>

Why type is not sufficient?

>etc.
>
>Summary: I believe the existing mechanism (i.e. global <groupId>, <id> -
>BTW, there is no global <type>) is too limitative and that it is
>preventing us from providing further added value for projects. The
>proposal above suggest a mechanism for extending it to support several
>deliverables.
>
>Comments? (I'm sure there'll be plenty ;-)).
>
>  
>
Some times ago I was thinking about doing this via plugin.

Say we have "foo" plugin (no nice name is coming to my minds at the moment)

with goals

foo:install
foo:install-snapshot
foo:deploy
foo:deploy-snapshot


foo:all-install
foo:all-install-snapshot
foo:all-deploy
foo:all-deploy-snapshot

and then properties like

maven.foo.main=jar
maven.foo.all=jar, javadoc,  javasources,




For example Implementation of foo:all-install can look like

foreach type in  {maven.foo.all} do
   <attainGoal name="{$type}:install"/>
end


Then this plugin can be used by multiproject  plugin (in 
multiproject:install, multiproject:deploy etc) andfor creation of pages 
with download information

I knew some reason why such functionality should not be based on 
informaton which is kept in POM (<deliverables>)
(I have to refresh my memory and recall them...)




Michal






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org