Maven术语 - 依赖和插件,存储库与pluginRepository [英] Maven terms -- dependency and plugin, repository vs. pluginRepository

查看:113
本文介绍了Maven术语 - 依赖和插件,存储库与pluginRepository的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经和Maven合作了好几天,但仍然对某些条款感到困惑:

I've been working with Maven for days but still get confused about some of the terms:

第一个问题是 repository 和 pluginRepository ?如果存在功能差异,那么我应该为两者添加一个网址吗?

First question is what is the difference between repository and pluginRepository? If there is functional difference so shall I put one url for both?

第二个问题是依赖和插件?也许它们是完全不同的项目比较,因为插件可以包含依赖项,但对我来说插件看起来像构建中的某种依赖项?就像这个 build 依赖于这些插件,其中一个插件依赖于依赖,我一直认为依赖是一种库jar,插件是库jar或者依赖于罐子里的项目...

Second question is what is the difference between dependency and plugin? Maybe they are totally different item to compare because plugin can include dependencies, but to me plugins look like some kind of dependencies in a build? Just like "This build depends on these plugins, and one of this plugin depends on that dependencies", I always think dependencies are kind of library jars, and plugins are library jars or depending projects in jars...

对不起,如果问题有点愚蠢,但我真的很困惑。请给出一个提示,谢谢。

Sorry if the question is kind of dumb, but I am really confused. Please give a hint, thanks.

推荐答案

回到Maven1.0,插件和普通工件存放在不同的存储库中(至于我知道)。在Maven2 +中,它们一起存储在存储库中。但是,许多不同的公司和项目都有许多不同的存储库,因此您必须选择所需的存储库。

Back in Maven1.0, plugins and normal artifacts were in different repositories (as far as I know). In Maven2+ they are stored together in a repository. But there are many different repositories out there from many different companies and projects so you have to pick the repositories you need.

插件是您在执行时使用的工具你的maven构建。例如,编译器插件将您的Java代码编译为Bytecode。
普通依赖项是您在应用程序中使用的工件,如库。

A plugin is a tool you use at the execution of your maven build. For example, the compiler plugin compiles your Java code into Bytecode. A normal dependency are artifacts you use in your application like libraries.

插件和工件都可以具有传递依赖性。这意味着他们自己有依赖。

Both plugins and artifacts can have transitive dependencies. That means they have dependencies themselves.

这篇关于Maven术语 - 依赖和插件,存储库与pluginRepository的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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