通过maven pom.xml在“Classpath”末尾的java清单中添加自定义字符串

时间:2016-12-18 11:06:08

标签: maven pom.xml meta-inf

我正在尝试更新清单文件,在类路径中添加一对新行。

我的pom中有这样的东西:

<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <configuration>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addClasspath>true</addClasspath>
                                </manifest>
                                <manifestEntries>
                                    <Class-Path>./ttttttttttttttt/</Class-Path>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </plugin>

这一变化的结果是下一个:

Manifest-Version: 1.0
Implementation-Title: server
Implementation-Version: 0.1.0-SNAPSHOT
Archiver-Version: Plexus Archiver
Built-By: vcima
Implementation-Vendor-Id: es.solution.ok
Class-Path: **../ttttttttttttttt/** configuration-0.1.0-SNAPSHOT.jar 
 tip-0.1.0-SNAPSHOT.jar quartz-2.2.1.jar c3p0-0.9.1.1.jar quartz-
 jobs-2.2.1.jar 
company: My company
Created-By: Apache Maven 3.3.3
Build-Jdk: 1.8.0_111
Main-Class: es.example.srv.ServerRunner

这是正确的但我需要在类路径的末尾添加新行有几个原因:在这种情况下库的顺序很重要......

我正在寻找这样的解决方法:

Manifest-Version: 1.0
    Implementation-Title: server
    Implementation-Version: 0.1.0-SNAPSHOT
    Archiver-Version: Plexus Archiver
    Built-By: vcima
    Implementation-Vendor-Id: es.solution.ok
    Class-Path: configuration-0.1.0-SNAPSHOT.jar 
     tip-0.1.0-SNAPSHOT.jar quartz-2.2.1.jar c3p0-0.9.1.1.jar quartz-
     jobs-2.2.1.jar **../ttttttttttttttt/** 
    company: My company
    Created-By: Apache Maven 3.3.3
    Build-Jdk: 1.8.0_111
    Main-Class: es.example.srv.ServerRunner

有人可以帮助我吗?。

祝你好运!

0 个答案:

没有答案