0

I failed to start Maven project. The error showing:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 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-quickstart:pom:1.1 from/to central (https://repo.maven.apache.org/maven2): Connect timed out
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 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-quickstart:pom:1.1 from/to central (https://repo.maven.apache.org/maven2): Connect timed out

In my previous project, I also cannot install JAR with Maven install in Spring Tools Suite, so I install with command prompt mvn install. I had create the setting proxy in settings.xml with same proxy like browser setting.

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>
    <id>myproxy</id>  
      <active>true</active>
      <protocol>http</protocol>
      <host>idnproxy.pru.intranet.asia</host>
      <port>8080</port>
      <username>c76266</username>
      <password>Password09</password>
      <nonProxyHosts>localhost|128.*.*.*|10.*.*.*|*.intranet.asia|*.group.local</nonProxyHosts>
    </proxy>
  </proxies>

  <servers>    
  </servers>

  <mirrors>

  <mirror>
    <name>Spring Milestones</name>  
      <id>spring-milestones-secure</id>
      <url>http://repo.spring.io/libs-milestone</url>
      <mirrorOf>spring-milestones</mirrorOf>
    </mirror>

  </mirrors>

  <profiles>
  </profiles>

</settings>

How to solve this problem? When I install JAR with command prompt, it succeeds. Why? Thanks.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Albertus Bobby
  • 75
  • 2
  • 14
  • https://stackoverflow.com/questions/21537405/where-is-the-settings-xml-used-by-maven-in-the-spring-tool-suite : it seems that STS comes with its own maven. Try configuring it instead of your global maven. – Roman Puchkovskiy Nov 27 '17 at 09:13
  • Your host cannot reach the Maven repository: "Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from/to central (https://repo.maven.apache.org/maven2): Connect timed out". Fix your configuration and try to ping repo.maven.apache.org Consult your administrator. – actc Nov 27 '17 at 09:14
  • I had successed maven install in eclipse with add the runtime maven but I still can't create the maven project. the same error show. I have a setting.xml in maven/conf folder and .m2 folder, both I add the proxy. in my STS, in my maven setting, I add setting.xml (conf folder) for global setting and setting.xml in .m2 folder for user setting. is it true? – Albertus Bobby Nov 27 '17 at 09:36
  • @actc: how to fix that repository? thanks – Albertus Bobby Nov 27 '17 at 09:38
  • As pointed out by @actc, your Maven network config seems incorrect. You probably need to configure a proxy, look for Maven proxy configuration you'll have lot of resources – Pierre B. Nov 27 '17 at 11:46
  • as far, I had configure in setting.xml, I had put the proxy be like in my browser, in my browser, I can internet.. have other configure? thanks – Albertus Bobby Nov 28 '17 at 02:35

0 Answers0