Maven Shared Components

custom classpath layout type using layout ${artifact.artifactId}.${artifact.extension} generate null.null

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: maven-archiver-2.4
  • Fix Version/s: maven-archiver-2.4
  • Component/s: maven-archiver
  • Labels:
    None
  • Environment:
    windows XP, maven 2.0.9, jdk 1.4.2_11
  • Number of attachments :
    0

Description

Hello,

My need is to dynamically create the Manifest, based on pom datas. For classpath, I'd like to list dependencies using only their artifactId (without version).
so, on maven2 jar plugin, I've tried to add the configuration, as defined at http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Custom
Dependency to version 2.4 of maven-archiver is well managed.
Using it, I generate the following entry in the MANIFEST.MF :
...
Class-Path: null.null null.null null.null null.null
...

As you can see, I have 4 dependencies. Where is the problem ?
... I've tried to use it with maven-artifact:2.0.9 - no more success.
Have you an idea ? Does it works for you ?

Thinks for your help

Herve

Activity

Hide
Ronald van de Kuil added a comment -

It works fine for me:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<finalName>HbrLibrary</finalName>
<archive>
<index>true</index>
<!-- currently, log4j -->
<manifest>
<addClasspath>true</addClasspath>
<classpathLayoutType>custom</classpathLayoutType>
<customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout>
</manifest>
<manifestEntries>
<ServiceLibrary>true</ServiceLibrary>
</manifestEntries>

<!-- do not update the archive when its timestamp is older than any of the included files -->
<forced>false</forced>

</archive>
</configuration>
<!-- support for the customClasspathLayout -->
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
</plugin>

Show
Ronald van de Kuil added a comment - It works fine for me: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> <configuration> <finalName>HbrLibrary</finalName> <archive> <index>true</index> <!-- currently, log4j --> <manifest> <addClasspath>true</addClasspath> <classpathLayoutType>custom</classpathLayoutType> <customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout> </manifest> <manifestEntries> <ServiceLibrary>true</ServiceLibrary> </manifestEntries> <!-- do not update the archive when its timestamp is older than any of the included files --> <forced>false</forced> </archive> </configuration> <!-- support for the customClasspathLayout --> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-archiver</artifactId> <version>2.4</version> </dependency> </dependencies> </plugin>
Hide
Jens Meiß added a comment -

Hi all,

its an documentation issue, we have to use:

$${artifact.artifactId}.$${artifact.extension}

instead of:

${artifact.artifactId}.${artifact.extension}

pleas fix the Documentation

thx

Show
Jens Meiß added a comment - Hi all, its an documentation issue, we have to use: $${artifact.artifactId}.$${artifact.extension} instead of: ${artifact.artifactId}.${artifact.extension} pleas fix the Documentation thx
Hide
Kristian Rosenvold added a comment -

Updated documentation in r941597 (commit incorrectly tagged as MSHARED-40)

Show
Kristian Rosenvold added a comment - Updated documentation in r941597 (commit incorrectly tagged as MSHARED-40)
Hide
Dennis Lundberg added a comment -

I have changed the commit message to the correct one now.

Show
Dennis Lundberg added a comment - I have changed the commit message to the correct one now.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: