开发者

hunting maven dependencies

开发者 https://www.devze.com 2022-12-31 20:21 出处:网络
I want to start using maven in c开发者_如何学编程ode I distribute but I can\'t find an efficient way to work with dependencies. Every new dependency takes me far too long to add.

I want to start using maven in c开发者_如何学编程ode I distribute but I can't find an efficient way to work with dependencies. Every new dependency takes me far too long to add.

As a simple example, I need to add Tomcat for compilation. Do I really have to manually trawl the repo in my browser to find the group-id, artifact-id and version number?

In every case it seems easier to find the non-maven downloads. I hope I've missed something obvious.


Do I really have to manually trawl the repo in my browser to find the group-id, artifact-id and version number?

No. Use a repository search engine. Some are mentioned here, more here. Some IDE also offer facilities to search and add dependencies (e.g. Eclipse with m2eclipse).


First of all, using some IDE really helps. Eclipse has m2eclipse plugin and if you define locations of remote maven repositories in your pom definition, you can add dependencies in its pom editor and it will automatically search the proper artifacts for you.


What is really helpful is using repository manager like Nexus / Artifactory, where you gather the most important maven repositories and then you don't need to declare particular repository locations in your pom definition for various artifacts, but everything will be proxied via Nexus.

0

精彩评论

暂无评论...
验证码 换一张
取 消