如何使用maven将Class-Path添加到清单文件中

use*_*026 12 java manifest maven

当使用maven-jar-plugin时,
我想在Manifest.mf中添加条目,
所以它将包含:
Class-Path :.
当我将此条目添加到Pom时:

<Class-Path>.</Class-Path> 
Run Code Online (Sandbox Code Playgroud)

它将创建具有所有依赖性的 Class-Path
Like:
Class-Path :. jar1name.jar jar2name.jar等
而不仅仅是
Class-Path :.
有没有办法避免maven将所有jar名称添加到Class-Path?
谢谢

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                    <manifestEntries>
                        <Built-By>Me</Built-By>
            <Class-Path>.</Class-Path> 
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

use*_*026 24

这样就
省去了addClasspath并添加了manifestEntries
现在,log4j.properties可以驻留在jar之外 - 并且仍然可以找到...

                <manifest>
                    <addClasspath>true</addClasspath>
                </manifest>
Run Code Online (Sandbox Code Playgroud)

这是有效的:

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifestEntries>
                        <Built-By>Me</Built-By>
             <Class-Path>.</Class-Path>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

输出:

 Manifest-Version: 1.0
 Archiver-Version: Plexus Archiver
 Created-By: Apache Maven
 Build-Jdk: 1.6.0_45
 Built-By: Me
 Class-Path: .
Run Code Online (Sandbox Code Playgroud)