Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure MAVEN?

Tags:

maven-2

I am a newbie to maven and i gone through the configuration steps given in Apache site, but still i cant configure it. So anyone please help me with simple steps to configure MAVEN in windows. Thanks in advance.

EDITED

C:\Documents and Settings\arselv>mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-         resources-     plugin/2.3/maven-resources-plugin-2.3.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-  plugin/2.3/maven-resources-plugin-2.3.pom
 [INFO] ------------------------------------------------------------------------
 [ERROR] BUILD ERROR
 [INFO] ------------------------------------------------------------------------
 [INFO] Error building POM (may not be this project's POM).

 Project ID: org.apache.maven.plugins:maven-resources-plugin
 Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in   repository: Unable to download the artifact from any repository
 org.apache.maven.plugins:maven-resources-plugin:pom:2.3
 from the specified remote repositories:
 central (http://repo1.maven.org/maven2)
 for project org.apache.maven.plugins:maven-resources-plugin

 [INFO] ------------------------------------------------------------------------
 [INFO] For more information, run Maven with the -e switch
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 42 seconds
 [INFO] Finished at: Fri Feb 05 13:10:06 IST 2010
 [INFO] Final Memory: 2M/5M
 [INFO] ------------------------------------------------------------------------

So Above is the Error whil trying to do the steps given in apache site.

like image 838
i2ijeya Avatar asked Feb 05 '10 07:02

i2ijeya


2 Answers

If you are behind a proxy, you need to configure Maven to use this proxy. To do so, edit or create the file ${user.home}/.m2/settings.xml and add the following snippet to it:

<settings>
  .
  .
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.somewhere.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
    </proxy>
  </proxies>
  .
  .
</settings>
like image 115
Pascal Thivent Avatar answered Oct 28 '22 04:10

Pascal Thivent


One thing you can try if you're missing a particular resource, is to browse the repository directly, e.g. http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/

In this case it looks like the 'maven-resources-plugin' is present. If you are behind a firewall, it might be worth editing your /conf/settings.xml to specify proxy details.

Another thing you can try is to execute the mvn command with -U. This should force an update of resources not in your local repository.

like image 25
lucrussell Avatar answered Oct 28 '22 02:10

lucrussell