Omar NourdeaN
Omar NourdeaN

Reputation: 503

Maven 3 Eclipse Kepler is it necessary to have the environment variable to work for embedded Maven?

I have installed the last version of kepler the one has the maven embedded in it when I tried many times to create application from any archetype I always got

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-webapp:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-webapp/maven-metadata.xml in local (C:\Users\onourdean\.m2\repository)

even though:

  1. I have deleted the repository folder inside .m2 and its created again by it self
  2. I have downloaded an external maven and used it
  3. I made the proxy in sittings on both the embedded and the external

any other ideas? My settings.xml

  <?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
 </pluginGroups>
 <proxies>
  <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>stsproxy</host>
      <port>8080</port>
      <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>
 <servers>
 </servers>
 <mirrors>
 </mirrors>
 <profiles>
 </profiles>
</settings>

Note That:
i have tried all the soultions in the Create a Maven project in Eclipse complains "Could not resolve archetype" except making a variable for maven due to company restriction so is this variable necessary to run the embedded version?

Upvotes: 2

Views: 390

Answers (2)

Omar NourdeaN
Omar NourdeaN

Reputation: 503

Its seems there is a bug in the embedded version even if i use it outside of the proxy just used the external version

then use wagon-http-lightweight-2.2.jar as described in Can access maven repository from behind proxy, need help

and its worked

Upvotes: 2

Nicola Musatti
Nicola Musatti

Reputation: 18228

I'm not sure if it's still the same with Kepler, but with earlier Eclipse (and M2E) releases this problem usually goes away if you go to Window -> Preferences -> Maven -> Installations and add your local, external Maven installation, which usually causes Eclipse to pick up the correct settings.xml file.

Upvotes: 0

Related Questions