tags:

views:

56

answers:

5

Is there an easy way to download all the official Maven plugins (http://maven.apache.org/plugins/index.html) with one command?

I'm setting up an offline repository for use within a corporate environment and I wanted to make sure that I had all the official maven plugins available.

+1  A: 

If you mean all existing Maven plugins, I would say not, as plugins are not developed only by the Maven and Codehaus teams, but also by third parties. So I guess you can't even know for sure whether you know all of them, much less download.

If you mean all Maven plugins configured within a project pom, Maven does that automatically upon build. If you want the latest versions of your configured plugins, use the Maven Versions plugin with the display-plugin-updates goal.

Péter Török
A: 

There's no such thing as all maven plugins, because all plugins are artifacts at some repository (by default the central maven repository).

Repositories can be added so even if you download all artifacts from central repository they still may be plugins from third party repository that you didn't know about.

Basically to download all plugins from central repository you may download the index and search for every artifact in the repository to check whether it's a plugin or not and download it.

Well, you probably don't want to do it.

Vitaly Polonetsky
Sorry, I should have said all official Maven plugins as listed on the page http://maven.apache.org/plugins/index.html
Pram
+1  A: 

You'd have to download a full repository (like central) and this is absolutely not appreciated. Apart from that - you'd have to synchronize your local copy with central quite often.

I once had the requirement to maintain an offline repository for a team using maven. I installed nexus on a local server (not connected with the web) and synchronized it 'manually' with another nexus outside the isolated domain. You can 'run' a pom so that it does nothing but downloading all dependencies. And that's what I did on the nexus which had connection to the internet.

Andreas_D
A: 

Is there an easy way to download all the Maven plugins with one command?

I guess that you need to go offline but the short answer is no.

  1. There is no exhaustive list of all plugins and plugins are not centralized in a single place so if you don't know what you're looking for, what does "all" mean?
  2. You don't want to wget them (this won't give you plugins dependencies).
  3. You don't want to crawl the entire (central) repository.

A plugin must be used (assuming the relevant pluginRepository element is declared in the POM) to get downloaded. So your best bet is to create a "fake" POM with all the plugins you think you'll need and to let Maven do its job. But I sincerely wish you good luck with this task, this is going to take some time.

Pascal Thivent
A: 

Have you tried to use Nexus? It seems to be a good repo-manager.

matheus.emm