Maven Jar Plugin和Maven Assembly Plugin有什么区别? [英] What are the differences between Maven Jar Plugin and Maven Assembly Plugin?

查看:200
本文介绍了Maven Jar Plugin和Maven Assembly Plugin有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能解释一下这两个Maven插件之间的确切区别吗?什么时候使用其中一个插件很有用?

Could somebody explain me the exactly differences between these two Maven plugins and when it is useful to work with one of these plugins?

推荐答案

Maven jar插件只是创建一个jar文件,其中包含所有 SOURCE文件[.java文件编译的.class文件] 但是jar本身无法部署,因为有许多依赖项,如第三方jar文件或其他库jar文件,它们需要执行 SOURCE jar 文件。

Maven jar plugin simply creates a jar files with all SOURCE files [.class files compiled from .java files] packed in it but a jar itself cannot be deployed as there are many more dependencies like 3rd party jar files or other library jar files which are needed to executed SOURCE jar file.

这是Maven 程序集插件的图片,它会创建一个包含您选择的扩展名的包,如。 zip,.tar,.gz 这是一个完全可部署的包,其中包含所有依赖项。您还可以在程序集插件中指定目录结构,这应该在服务器上部署包时创建。

This is where Maven assembly plugin comes into picture, it creates a package of an extension of your choice like .zip, .tar, .gz which is a fully deploy-able package with all dependencies packed in it. You can also specify directory structure in assembly plugin which should be created when package is deployed on server.

因此,程序集插件总是与jar插件结合使用。

So a assembly plugin is always used in combination with jar plugin.

这篇关于Maven Jar Plugin和Maven Assembly Plugin有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆