You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by 亢龙不悔 <10...@qq.com> on 2016/12/21 11:52:40 UTC

maven-jar-plugin

I add this plugin to my project ,but it doesn't work ,the generated jar package doesn't  contain dependcy jars
who can help me?


<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<archive>
						<manifest>
							<mainClass>cn.com.epicc.StartMain</mainClass>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
					<classesDirectory>
					</classesDirectory>
				</configuration>
			</plugin>

Re: maven-jar-plugin

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi,

> I add this plugin to my project ,but it doesn't work ,the generated
> jar package doesn't  contain dependcy jars

The maven-jar-plugin does not aggregate dependencies.

To do that, check out these plugins:

* http://maven.apache.org/plugins/maven-assembly-plugin/
* https://maven.apache.org/plugins/maven-shade-plugin/
* http://one-jar.sourceforge.net/

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden


On Wed, Dec 21, 2016 at 5:52 AM, 亢龙不悔 <10...@qq.com> wrote:

> I add this plugin to my project ,but it doesn't work ,the generated jar
> package doesn't  contain dependcy jars
> who can help me?
>
>
> <plugin>
>                                 <groupId>org.apache.maven.
> plugins</groupId>
>                                 <artifactId>maven-jar-plugin</artifactId>
>                                 <version>2.4</version>
>                                 <configuration>
>                                         <archive>
>                                                 <manifest>
>
> <mainClass>cn.com.epicc.StartMain</mainClass>
>
> <addClasspath>true</addClasspath>
>
> <classpathPrefix>lib/</classpathPrefix>
>                                                         <
> addDefaultImplementationEntries>true</addDefaultImplementationEntries>
>                                                 </manifest>
>                                         </archive>
>                                         <classesDirectory>
>                                         </classesDirectory>
>                                 </configuration>
>                         </plugin>