Maven: how to install the plugin offline

I am sitting behind a firewall and therefore maven cannot connect to the central repositories (error message is given below).

However, I can connect to the Internet through HTTP.

How to install the maven plugin (e.g. archetype) offline (for example, load some file in a browser and then install the plugin by running some commands)?

Thanks in advance

Dmitry

R. S .: Here is the error message:

E:\>mvn archetype:generate -DarchetypeGroupId=com.vaadin
 -DarchetypeArtifactId=vaadin-archetype-clean -DarchetypeVersion=LATEST -DgroupI
d=at.swdev -DartifactId=pcc -Dversion=1.0 -Dpackaging=war
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: Connecti
on refused: connect
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Jul 22 15:17:00 CEST 2010
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
+5
source share
3 answers

I am sitting behind a firewall and therefore maven cannot connect to the central repositories (error message is given below). However, I can connect to the Internet through HTTP.

, , Maven HTTP. - -, Maven , - ~/.m2/settings.xml. . .

maven (, archetype) (, , , )?

, install:install-file (. Usage). , . . ( Maven ). , :

  • Maven , ~ ~
  • (, Nexus) , , ) Maven ~ ~
  • " " maven ( ) • ~
  • Maven
+7

-, , . .

, /- http. Maven , . mvn dependency: go-offline

, maven .

svn co (http ) appfuse-demos.googlecode.com/svn/trunk/helloworld ( ) mvn install ( , ) mvn dependency: go-offline ( . Help: Maven, , (, , ) .)

m2 (~/m2/repository) , . . . (nexus, artifactory..)

.

http://maven.apache.org/plugins/maven-dependency-plugin/

0

I assume that your security firewall does not allow you to download maven from the central repository. That way, you can simply specify the mirrors in the settings.xml file in maven_home. if you have any repository for your company called nexus, specify the URL of this communication server in the mirror section in your settings.xml. Please note that if you do not have a repo for your company, you need to download all the dependencies offline and install it using the mvn installation in the local repository on your build server.

0
source

All Articles