You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Peter Donald <pe...@realityforge.org> on 2003/01/11 02:20:03 UTC

Re: A tale of two builds (or: Why I don't like the =?utf-8?q?SNAPSHOT

On Sat, 11 Jan 2003 03:58, Brian Ewins wrote:
> Peter Donald wrote:
> >On Wed, 8 Jan 2003 21:44, Brian Ewins wrote:
> >>I don't think indirect dependencies are quite so straightforward. [snip]
> >
> >I would highly recomend that you use the JDK "Optional Package" or
> > "Extension" mechanisms for this. Basically for each jar you define a set
> > of extensions that the jar provides and a set of extensions that the jar
> > needs.
>
> Well its the jar versioning mechanism spec you mean[1], 

No its not ;) It is the spec that was called "Extension" spec in JDK1.2 and 
got renamed to the "Optional Package" specification in JDK1.3. It is the same 
extension that servlet engines and EJB engines must support. 

See;
http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html

> Unfortunately this mechanism is currently a fiction created to torment
> writers of build tools ;)

Its a bit like that. A worst thing is that some things that actually implement 
it (ie Tomcat) are broken with transitive dependencies in some arrangments ;(

>       <manifest>
>         <attribute name="Built-By" value="${user.name}" />
>         <section name="${pom.package}">
>           <attribute name="Specification-Title" value="${pom.id}" />
>           <attribute name="Specification-Version"
>                      value="${pom.currentVersion}" />
>           <attribute name="Specification-Vendor"
>                      value="${pom.organization.name}" />
>           <attribute name="Implementation-Title"
>                      value="${pom.package}" />
>           <attribute name="Implementation-Version"
>                      value="${pom.currentVersion}" />
>           <attribute name="Implementation-Vendor"
>                      value="${pom.organization.name}" />
>         </section>
>       </manifest>

The Extension spec has a slightly different format. Namely it replaces 
"Specification-Title" with "Extension-Name" and allows you to specify 
dependencies via something like

Extension-List: trax velocity
velocity-Extension-Name: org.apache.velocity
velocity-Specification-Version: 1.0
trax-Extension-Name: Java API for XML Parsing
trax-Specification-Version: 1.1
trax-Implementation-Title: org.apache.xalan.xslt
trax-Implementation-Version: 2.1.0
trax-Implementation-Vendor: Apache Software Foundation

Maven could add those dependencies by scanning and selecting dependencies from 
its POM. Though I am not sure how to determine which dependencies are runtime 
... does Maven have a way to do this?

> Note several POM entries are reused, instead of having separate entries
> in the POM for the different pieces, and use the values above as
> defaults. The only way to override the info at present is to write a
> manifest by hand. It seems to me like it should be possible - compulsory
> even ;) -  to have this info in the POM since maven is targeted at
> producing a single artifact per project.

+1

-- 
Cheers,

Peter Donald
*-----------------------------------------------------*
* "Faced with the choice between changing one's mind, *
* and proving that there is no need to do so - almost *
* everyone gets busy on the proof."                   *
*              - John Kenneth Galbraith               *
*-----------------------------------------------------*