verystrongjoe
verystrongjoe

Reputation: 3921

I want to make manifest.mf file included two classpaths using Maven

I want to make manifest.mf file included two classpaths using Maven

pom.xml

<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>./dependency</classpathPrefix>
<mainClass>com.sds.afi.run.SimsMain</mainClass>
</manifest>

Then, the manifest.mf is generated like below.

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: arnold
Build-Jdk: 1.6.0_27
Main-Class: com.sds.afi.run.SimsMain
Class-Path: ./dependency/mina-core-1.1.7.jar ./dependency/mina-integra
 tion-spring-1.1.7.jar ./dependency/mina-filter-ssl-1.1.7.jar ./depend
 ency/spring-integration-core-2.0.4.RELEASE.jar ./dependency/spring-in
 tegration-mail-2.0.4.RELEASE.jar ./dependency/spring-context-support-
 3.0.5.RELEASE.jar ./dependency/spring-integration-ip-2.0.4.RELEASE.ja
 r ./dependency/spring-integration-stream-2.0.4.RELEASE.jar ./dependen
 cy/commons-lang-2.6.jar

**And I want to attach "." at the last.

How can I solve this problem? Thanks**

Upvotes: 0

Views: 2459

Answers (1)

Jean-R&#233;my Revy
Jean-R&#233;my Revy

Reputation: 5677

You can add other entries doing this

<configuration>
    <archive>
        <manifest>
            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            <addClasspath>true</addClasspath>
            <mainClass>com.sds.afi.run.SimsMain</mainClass>
        </manifest>
        <manifestEntries>
            <Class-Path>.</Class-Path>
        </manifestEntries>
    </archive>
</configuration>

But I'm not sure it makes sense ...

Please, tell us why you want to add this.

Additionnaly, this question has been debated a lot of time. Please use search link : https://stackoverflow.com/search?q=adding+.+classpath+manifest+maven&submit=search

You'll probably see this : Maven - how can I add an arbitrary classpath entry to a jar?

An the answer seems to be the same : https://stackoverflow.com/a/5893391/1047365

Upvotes: 1

Related Questions