maven in 5 min not working

前端 未结 7 966
花落未央
花落未央 2020-12-01 06:47

I have downloaded latest

maven 3.0.3, java version \"1.6.0_18\".

mvn –version

Apache Maven 3.0.3 (r1075438;          


        
相关标签:
7条回答
  • 2020-12-01 07:02

    I just copied setting.xml which comes under "\apache-maven-3.1.1\conf" directory, to the directory "${user.home}/.m2/)" of windows machine and change the required proxy setting according to my network as below and it worked for me.

    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>www-proxy.xxxx</host>
      <port>8080</port>
    </proxy>
    

    Thanks -- Kamran Shahzad

    0 讨论(0)
  • 2020-12-01 07:11

    Found solution:

    Solution #1:

    issue was with proxy in settings.xml file:

    <host>webproxy</host>
    

    to get host goto IE->tools->connection->LAN settings->advanced->http.

    =====

    Solution #2:

    if auto configured proxy is given: then

    1> open IE(or any browser)

    2> get the url address from your browser through IE->Tools->internet option->connections->LAN Settings-> get address and give in url eg: as http://autocache.abc.com/ and enter, a file will be downloaded with .pac format, save to desktop

    3> open .pac file in textpad, identify PROXY:

    In your editor, it will come something like:

       return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080"; 
    

    4> go to Maven settings.xml and enter as:

    <proxy>
          <id>optional</id>
          <active>true</active>
          <protocol>http</protocol>          
          <host>web-proxy.ind.abc.com</host>
          <port>8080</port>          
    </proxy>
    

    5> run mvn:install through command prompt or run through eclipse.

    =====

    Solution #3:

    For any other issues delete maven local repository and run mvn:install again.

    0 讨论(0)
  • 2020-12-01 07:13

    Window-Preferences-Maven-User Settings. Check, does settings.xml exists? if eclipse says no, get settings.xml from you friend or set the path to it.

    0 讨论(0)
  • 2020-12-01 07:15

    Try checking proxy settings in settings.xml file located under following directory:

    C:\Users\UserName\.m2

    0 讨论(0)
  • 2020-12-01 07:20

    We have observed that the maven project creation fails when it tries to download the archtype from this URL: Maven Repository which falls under "https" protocol.

    So solution #2 mentioned above worked only after a little change to the settings.xml. Instead of using "http" protocol I have to use "https"

    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>https</protocol>          
      <host>web-proxy.ind.abc.com</host>
      <port>8080</port>          
    

    Hope it helps someone.

    Note: Make sure that you check the following internet settings.

    Internet Explorer > Internet Options > Connections [TAB] > LAN Settings > Under Proxy server check Use proxy server for LAN > Advanced > Check "same proxy server for all protocols" and Click OK.

    0 讨论(0)
  • 2020-12-01 07:20

    Adding below under proxy tag in settings.xml worked for me

    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>https</protocol>          
      <host>web-proxy.ind.abc.com</host>
      <port>8080</port>  
    </proxy>
    
    0 讨论(0)
提交回复
热议问题