Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure eclipse EE to use the external maven (Windows 7)

Tags:

maven

New to maven. When I run this command i get access denied error? any help? I am trying to configure maven to run with eclipse. Let me know if you need more information.

mvn -Declipse.workspace=<c:\temp\eclipse\workspace>eclipse:add-mvn-repo

Path:
C:\apache-tomcat-7.0.55\bin;C:\apache-ant-1.9.4-bi
n\bin;C:\apache-maven-3.2.2\bin;C:\Program Files (x86)\Google\google_appengine\

C:\Temp\eclipse\workspace>mvn -v
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:4
2-04:00)
Maven home: C:\apache-maven-3.2.2\bin\..
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
C:\Temp\eclipse\workspace>cd\Temp\eclipse\workspace

**C:\Temp\eclipse\workspace>mvn -Declipse.workspace=<C:\Temp\eclipse\workspace> eclipse:add-maven-repo
Access is denied.
C:\Temp\eclipse\workspace>**
like image 363
Shona Avatar asked Aug 23 '14 15:08

Shona


People also ask

How do I know if Maven plugin is installed in Eclipse?

To check maven is configured properly: Open Eclipse and click on Windows -> Preferences. Choose Maven from left panel, and select installations. Click on Maven -> "User Settings" option form left panel, to check local repository location.

Do I need to install Maven for Eclipse?

You can Launch Maven builds from within Eclipse. It does the dependency management for Eclipse build path based on Maven's pom. xml. It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository (requires dependency project be in same workspace).

What version of Maven Do I have Eclipse?

To check maven plugin version in eclipse: Click Window –> Preferences –> Maven –> Installation . It will show you installation window with Maven version.


1 Answers

Configuring Maven to run within Eclipse.

  1. Eclipse has an embedded version of Maven which you can use. Assuming that you want to use Maven within Eclipse and outside of it, download Maven from http://maven.apache.org/download.cgi, extract it and set the M2_HOME environment variable such that it points to your local Maven installation directory.

  2. Set JAVA_HOME environment variable so that it points to the JDK which you want to use.

  3. Append %JAVA_HOME%\bin and %M2_HOME%\bin to the Path so that the jdk and mvn executables can be executed from anywhere.

  4. Now open an Eclipse Workspace and go to Window > Preferences > Maven > Installations. If you want to use your standalone installation instead of using the embedded one, you can change it here.

  5. If you have a specific Maven settings file which you want to use, then dump that settings.xml file under the .m2 folder of your User home directory.

  6. Once this is done, you can easily use Maven from within eclipse.(File > Import > Maven > Existing Maven Projects) or create a new one (File > New > Maven > Maven Project). Once you have a project in your workspace, you can run different Maven goals on it by right clicking on the Project and selecting what you want from the Run As option.

like image 80
coderplus Avatar answered Sep 30 '22 18:09

coderplus