BalusC是正确的,您需要指示Maven 在条目中
MANIFEST.MF使用当前目录(
.)生成一个
Class-Path:。
jar-with-dependencies描述符来构建可执行JAR,则可以使用以下命令告诉插件这样做:
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.2</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>com.stackoverflow.App</mainClass> </manifest> <manifestEntries> <Class-Path>.</Class-Path> <!-- HERE IS THE importANT BIT --> </manifestEntries> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <!-- this is used for inheritance merges --> <phase>package</phase> <!-- append to the packaging phase. --> <goals> <goal>single</goal> <!-- goals == mojos --> </goals> </execution> </executions> </plugin>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)