Daniel Fagerstrom wrote:


We could use the artifactId from the META-INF/maven/org.apache.cocoon/cocoon-block-name/pom.properties file.

pom.properties is included by default, but it's inclusion can be disabled. For this I think the manifest entry would be a better option here.


Maven also sometimes (?) creates some field in the manifest file that could be used e.g.:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: maven
Build-Jdk: 1.4.2_06
Extension-Name: cocoon-batik-impl
Specification-Title:
Specification-Vendor: The Apache Software Foundation
Implementation-Vendor: The Apache Software Foundation
Implementation-Title: cocoon-batik-impl
Implementation-Version: 1.0.0-SNAPSHOT

I doesn't create such manifest files all the time though. The jars created when I compile locally with Maven 2.0.4 looks like:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: Daniel Fagerstrom
Build-Jdk: 1.5.0_06

The generated default manifest is different for artifacts produced using mvn deploy/release versus those produced using mvn install.

One possibility would to have a block specific manifest entry with the block name:

Cocoon-Block-Name: cocoon-batik-impl

Yup, just include this in the root pom:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>2.1</version>
  <configuration>
    <archive>
      <manifestEntries>
        <Cocoon-Block-Name>${pom.artifactId}</Cocoon-Block-Name>
      </manifestEntries>
    </archive>
  </configuration>
</plugin>


HTH
Jorg

Reply via email to