[英]Set custom classpath maven-jar-plugin
I want to add custom classpath to manifest file of my project. 我想将自定义类路径添加到项目的清单文件中。 The classpath should point to all the files within a particular directory(lib). 类路径应指向特定目录(lib)中的所有文件。 Something like lib/.
类似于lib/.
or lib/*
Have tried specifying in entry to manifestEntries
of maven-jar-plugin
configuration but it doesn't seem to work. 或lib/*
曾尝试在maven-jar-plugin
配置的manifestEntries
条目中指定,但似乎不起作用。 Kindly recommend how to do it ? 请推荐该怎么做?
UPDATE UPDATE
What I want is something like this- 我想要的是这样的东西-
<manifestEntries>
<Class-Path>lib*</Class-Path>
</manifestEntries>
I want to add all the jars present in the lib
directory even though they may not be project's dependencies. 我想添加lib
目录中存在的所有jar,即使它们可能不是项目的依赖项也是如此。
I think the following worked for me sometime back using classpathPrefix 我认为以下某些时候使用classpathPrefix对我有用
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<classpathLayoutType>repository</classpathLayoutType>
</manifest>
</archive>
</configuration>
</plugin>
Original link: maven-jar-plugin 原始链接: maven-jar-plugin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.