Dreamer
Dreamer

Reputation: 7551

Maven terms -- dependency and plugin, repository vs. pluginRepository

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

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

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.

Upvotes: 36

Views: 47237

Answers (1)

keiki
keiki

Reputation: 3459

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.

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.

Upvotes: 52

Related Questions