2

Hi I am not able to create Maven Project in my machine.Below are my configurations

Eclipse Version: Mars.1 Release (4.5.1)
Maven Version: m2e, Maven Integration for Eclipse, 1.6.2

I am behind a corporate proxy. I have tried to configure the settings file inside .m2 directory and it is not working. Below is my settings file

<?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">

<proxies>
 <proxy>
 <id>myproxy</id>
 <active>true</active>
 <protocol>http</protocol>
 <host>XX.XX.XX.XX</host>
 <port>8080</port>
 <nonProxyHosts></nonProxyHosts>
 <username>USERNAME</username>
 <password>PASSWORD</password>
 </proxy>
 </proxies>

</settings>

I saw lot of answers in StackOverflow regarding this issue, I tried and nothing works. I doubt, there is '@' character in my PASSWORD, does it cause any issues ? Also do we need to provide USERNAME as domain\USERNAME or only USERNAME ? And how to provide both http and https in the file ?

Stack Trace error

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Failure to transfer org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): connect timed out
Sarath S Nair
  • 603
  • 2
  • 14
  • 29

3 Answers3

0

In my experience.

  1. The '@" character is not the key problem. Since my pwd also include this character.
  2. Domain is not necessary to add
  3. Actually maybe you can try this way:

Config proxy information in your IDE (eg:eclipse) instead of config in settgins.xml which means remove all the configuration in your maven setting file

jiming
  • 101
  • 8
  • I have tried this also. My eclipse network connections settings showing the proxy information from system proxy. – Sarath S Nair Jan 29 '16 at 06:31
  • I assume that your system proxy is a link to your company proxy address. like this: http://proxyconf.company.com/ It's not correct if you just use this. Please paste this link to your broswer and will get a file which include all your proxy host. use that to take a try – jiming Jan 29 '16 at 06:44
0

Just change your maven installtion that solves problem

  1. Download maven binaries and extract it and set path variable accordingly.

  2. check on command prompt or terminal by typing mvn that it works!

  3. edit settings.xml inside that extracted binary package conf directory.

  4. navigate to windows -> preferences -> maven preferences -> Installtions

  5. add new installtion with proper path to that extracted maven binary folder.

that is it you will not face any problem anymore!

positivecrux
  • 1,307
  • 2
  • 16
  • 35
0

In my case I just did the below steps and its worked.

  1. Mentioned the proxy details in eclipse and maven(/user/.m2/settings.xml)
  2. Then removed all the *.lastupdated files from /user/.m2/repository
  3. Afterwards its worked fine
Vishnu T S
  • 3,476
  • 2
  • 23
  • 39