Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
363 views
in Technique[技术] by (71.8m points)

java - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...