Java 为什么只有一个lib没有';是否无法在MANIFEST.MF文件中工作?
当我使用manifest.mf文件中声明的依赖项运行应用程序时,我遇到了一个问题。 清单是正常的,只有使用ANT生成的特定库才会出现问题 MANIFEST.MF:Java 为什么只有一个lib没有';是否无法在MANIFEST.MF文件中工作?,java,manifest,xmlbeans,Java,Manifest,Xmlbeans,当我使用manifest.mf文件中声明的依赖项运行应用程序时,我遇到了一个问题。 清单是正常的,只有使用ANT生成的特定库才会出现问题 MANIFEST.MF: Manifest-Version: 1.0 Implementation-Title: my_project Implementation-Version: 0 Archiver-Version: Plexus Archiver Built-By: note Class-Path: ALL_LIBS Main-Class: myPac
Manifest-Version: 1.0
Implementation-Title: my_project
Implementation-Version: 0
Archiver-Version: Plexus Archiver
Built-By: note
Class-Path: ALL_LIBS
Main-Class: myPackage.MainClass
Implementation-Vendor: My Company
Created-By: Apache Maven 3.2.3
Build-Jdk: 1.8.0_31
Specification-Version: 3.4.2
我尝试过的一种方法是通过以下命令运行它:
“JAVA\u HOME\bin\JAVA.exe”-cp“main.jar;./lib/*”myPackage.MainClass
但是我不能在生产中这样做,所以,有人知道发生了什么吗?我分两步解决了我的问题 首先,我删除了所有ANT脚本(显然,在maven项目中生成这些脚本不是一个好的做法) 其次,我将插件添加到xmlbeans中,如下所示:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<version>2.3.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>xmlbeans</goal>
</goals>
</execution>
</executions>
</plugin>
org.codehaus.mojo
xmlbeans maven插件
2.3.3
生成源
xmlbeans
现在一切都很顺利