You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Vladimir Korenev <vk...@gmail.com> on 2009/03/15 22:14:11 UTC

How to set outputFileNameMapping for generated Class-Path in MANIFEST.MF?

Hi,
I specify the following outputFileNameMapping option in the assembly
descriptor to cut off version number from jar names. This is because
the produced jars are used in another project, and I don't want to
change the naming convention there.

    <moduleSet>
      ...
      <binaries>
        ...
        <outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
      </binaries>
    </moduleSet>

I also want to add a Class-Path entry to the main jar:

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

What I get is a Class-Path entry in manifest that contains jars with
version number, e.g.
Class-Path: jdom-1.1.jar.

I searched but I was not able to find the way to specify jar file name
format for Class-Path in manifest either for maven-jar-plugin or for
for jar format of maven-assembly-plugin.

I was able to suppress version number for jars which are build by this
maven build:
  <build>
    <finalName>${artifactId}</finalName>
    ...
  <build>
In this case maven-jar-plugin generates correct Class-Path entry. But
external jars like jdom are still included with their extension.

Is there a solution for this?

--Vova

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