You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Stephen McConnell <mc...@apache.org> on 2003/03/02 02:21:52 UTC
manifest generation in Maven
Hi everyone:
The current implementation of the java:jar target does not provide
support for the correct generation of manifiest extension information.
What is does do is provide a framework for appemnding manifest
information to a default model. In the work I've been doing this
approach has prooved to be unsufficient (or at least error prone).
Instead, I modified the java:jar plugin target to generate manifest
information based on the project descriptor.
The current manifest declaration is as folows:
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Created-By" value="Apache Jakarta Maven"/>
<attribute name="Package" value="${pom.package}"/>
<attribute name="Build-Jdk" value="${java.version}"/>
<section name="${pom.package}">
<attribute name="Specification-Title" value="${pom.artifactId}"/>
<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 manifest model I am using that generates compliant extensions is as
follows:
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Created-By" value="Apache Jakarta Maven"/>
<attribute name="Package" value="${pom.package}"/>
<attribute name="Build-Jdk" value="${java.version}"/>
<!-- added supplimentary entries to be compliant with extensions
spec -->
<attribute name="Extension-Name" value="${pom.artifactId}"/>
<attribute name="Specification-Version"
value="${pom.specificationVersion}"/>
<attribute name="Specification-Vendor"
value="${pom.organization.name}"/>
<attribute name="Specification-Title"
value="${pom.shortDescription}"/>
<attribute name="Implementation-Version"
value="${pom.currentVersion}"/>
<attribute name="Implementation-Vendor"
value="${pom.organization.name}"/>
<attribute name="Implementation-Vendor-Id"
value="${pom.organization.identifier}"/>
</manifest>
The above modification ensures that a jar file is established with (a)
an extension name and (b) an organization identifier. The organization
identifier attribute "Implementation-Vendor-Id" is assigned that value
derived from the property ${pom.organization.identifier} (which which I
have added in my maven.xml files) because this is required in some
containers (e.g. Tomcat). In my local environment I basically declare
this value as a property, however, I think the best solution would be to
add the notion of an organization identifier to the Organization object.
E.g.
<project>
<organization>
<name>OSM SARL</name>
<url>http://www.osm.net/</url>
<identifier>OSM</identifier>
</organization>
</project>
The value of ${pom.organization.identifier} can then be explicity
defined in the project file <organization><identifier> tag value. These
changes are consitent with the Optional Package Versioning Specification
available at:
http://java.sun.com/j2se/1.4/docs/guide/extensions/versioning.html
A diff of the java plugin jar target is attached (this addresses the
manifest generation but does not include enhancements to the
organization object model). However, the patch can be safely applied as
the organization identifier manifest entry will only be included if the
value of the ${pom.organization.identifier} is not null.
Cheers, Steve.
--
Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net
Re: manifest generation in Maven
Posted by Stephen McConnell <mc...@apache.org>.
dion@multitask.com.au wrote:
>Stephen,
>
>could you either email it as an attachment, or pop it into Jira as a bug
>report?
>
>Either of these would be fine.
>
It was attached to the original message - but its also attached to this
message as well.
Cheers, Steve.
--
Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net
Re: manifest generation in Maven
Posted by di...@multitask.com.au.
Stephen,
could you either email it as an attachment, or pop it into Jira as a bug
report?
Either of these would be fine.
--
dIon Gillard, Multitask Consulting
Blog: http://www.freeroller.net/page/dion/Weblog
Work: http://www.multitask.com.au
Stephen McConnell <mc...@apache.org> wrote on 04/03/2003 02:00:47 PM:
>
> Can someone take care of committing this?
> Cheers, Steve.
>
>
> Stephen McConnell wrote:
>
Re: manifest generation in Maven
Posted by Stephen McConnell <mc...@apache.org>.
Can someone take care of committing this?
Cheers, Steve.
Stephen McConnell wrote:
>
> Hi everyone:
>
> The current implementation of the java:jar target does not provide
> support for the correct generation of manifiest extension information.
> What is does do is provide a framework for appemnding manifest
> information to a default model. In the work I've been doing this
> approach has prooved to be unsufficient (or at least error prone).
> Instead, I modified the java:jar plugin target to generate manifest
> information based on the project descriptor.
<snip.>
>------------------------------------------------------------------------
>
>cvs diff plugin.jelly (in directory F:\dev\jakarta-turbine-maven\src\plugins-build\java)
>Index: plugin.jelly
>===================================================================
>RCS file: /home/cvspublic/jakarta-turbine-maven/src/plugins-build/java/plugin.jelly,v
>retrieving revision 1.7
>diff -r1.7 plugin.jelly
>176,183c176,183
>< <section name="${pom.package}">
>< <attribute name="Specification-Title" value="${pom.artifactId}"/>
>< <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>
>---
>
>
>> <!-- added supplimentary entries -->
>> <attribute name="Extension-Name" value="${pom.artifactId}"/>
>> <attribute name="Specification-Version" value="${pom.specificationVersion}"/>
>> <attribute name="Specification-Vendor" value="${pom.organization.name}"/>
>> <attribute name="Specification-Title" value="${pom.shortDescription}"/>
>> <attribute name="Implementation-Version" value="${pom.currentVersion}"/>
>> <attribute name="Implementation-Vendor" value="${pom.organization.name}"/>
>> <attribute name="Implementation-Vendor-Id" value="${pom.organization.identifier}"/>
>>
>>
>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-maven-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-maven-dev-help@jakarta.apache.org
>
--
Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net