i2ijeya
i2ijeya

Reputation: 16400

How to configure MAVEN?

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.

Upvotes: 10

Views: 19275

Answers (5)

Gary
Gary

Reputation: 7257

The problem you're seeing there is probably to do with not having a suitable network connection to the default Maven central repository.

Once you've got that network issue sorted, you'll need to get up to speed with Maven and what it can do for you. For that I'd suggest you read the Better Builds With Maven eBook. It'll tell you everything you need to know.

One handy tip during initial installation is if you are developing on a multiple user profile machine (i.e. you log into a network and your profile is synchronized at login/logout) you'll want to do the following:

1) Edit your /.m2/settings.xml so that your local repository is outside of your network profile to avoid moving gigs of data every day. An example configuration could be:

<settings>
<localRepository>/Users/Shared/Repository</localRepository>
</settings>

2) Consider using Artifactory to provide a company wide central Maven repository which will be the first port of call for resolving Maven artifacts with repo1.maven.org/maven2 being the second one. This will mean that your developed code stays in house and any specialised artifacts requiring licenses (such as Oracle JDBC drivers or JTA stuff) can be made available without manual installation.

If you need any further help or advice, please feel free to contact me.

Upvotes: 1

Pascal Thivent
Pascal Thivent

Reputation: 570285

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>

Upvotes: 13

lucrussell
lucrussell

Reputation: 5150

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.

Upvotes: 4

Romain Linsolas
Romain Linsolas

Reputation: 81577

The installation of Maven is really simple: Download the ZIP from the site, unzip it in any directory of your hard drive, and then, just add the bin/ directory in your PATH Windows system variable. This way, you will be able to run the command mvn ... from any other directory.

Upvotes: 0

aberrant80
aberrant80

Reputation: 12997

The simplest steps to follow is what is on:

http://maven.apache.org/download.html#Installation

You mentioned some steps on an Apache site. Was that the page you were looking at? Which step are you having trouble with?

Upvotes: 0

Related Questions