title: Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: org/b eanshell/bsh/2.0b4/bsh-2.0b4.jar from central failed
body: <p>I am trying to build my Maven project but it is failing to GET org/beanshell/bsh/2.0b4/bsh-2.0b4.jar from central repo <a href="http://repo.maven.apache.org/maven2" rel="nofollow">http://repo.maven.apache.org/maven2</a></p>
  
  <p>Below is the error trace when I used mvn archetype:generate from command line:</p>
  
  <pre><code>C:\Users\SO310400\workspace\analytics&gt;mvn -U -e archetype:generate
  [INFO] Error stacktraces are turned on.
  [INFO] Scanning for projects...
  Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
  metadata.xml
  Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadat
  a.xml
  Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-m
  etadata.xml (13 KB at 11.9 KB/sec)
  Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata
  .xml (20 KB at 15.6 KB/sec)
  Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
  archetype-plugin/maven-metadata.xml
  Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-a
  rchetype-plugin/maven-metadata.xml (730 B at 1.1 KB/sec)
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building Credit Dashboard Analytics 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; maven-archetype-plugin:2.3:generate (default-cli) @ analytics &gt;&gt;&gt;
  [INFO]
  [INFO] &lt;&lt;&lt; maven-archetype-plugin:2.3:generate (default-cli) @ analytics &lt;&lt;&lt;
  [INFO]
  [INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ analytics ---
  Downloading: http://repo.maven.apache.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0
  b4.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3:05.313s
  [INFO] Finished at: Tue Apr 07 13:10:12 IST 2015
  [INFO] Final Memory: 8M/19M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
  .3:generate (default-cli) on project analytics: Execution default-cli of goal or
  g.apache.maven.plugins:maven-archetype-plugin:2.3:generate failed: Plugin org.ap
  ache.maven.plugins:maven-archetype-plugin:2.3 or one of its dependencies could n
  ot be resolved: Could not transfer artifact org.beanshell:bsh:jar:2.0b4 from/to
  central (http://repo.maven.apache.org/maven2): GET request of: org/beanshell/bsh
  /2.0b4/bsh-2.0b4.jar from central failed: Connection reset -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
  rg.apache.maven.plugins:maven-archetype-plugin:2.3:generate (default-cli) on pro
  ject analytics: Execution default-cli of goal org.apache.maven.plugins:maven-arc
  hetype-plugin:2.3:generate failed: Plugin org.apache.maven.plugins:maven-archety
  pe-plugin:2.3 or one of its dependencies could not be resolved: Could not transf
  er artifact org.beanshell:bsh:jar:2.0b4 from/to central (http://repo.maven.apach
  e.org/maven2): GET request of: org/beanshell/bsh/2.0b4/bsh-2.0b4.jar from centra
  l failed
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
  .java:224)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
  .java:153)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
  .java:145)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
  ct(LifecycleModuleBuilder.java:84)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
  ct(LifecycleModuleBuilder.java:59)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
  ild(LifecycleStarter.java:183)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
  eStarter.java:161)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
  cher.java:289)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
  a:229)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
  uncher.java:415)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
  356)
  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
  li of goal org.apache.maven.plugins:maven-archetype-plugin:2.3:generate failed:
  Plugin org.apache.maven.plugins:maven-archetype-plugin:2.3 or one of its depende
  ncies could not be resolved: Could not transfer artifact org.beanshell:bsh:jar:2
  .0b4 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/
  beanshell/bsh/2.0b4/bsh-2.0b4.jar from central failed
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
  BuildPluginManager.java:87)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
  .java:208)
          ... 19 more
  Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.
  maven.plugins:maven-archetype-plugin:2.3 or one of its dependencies could not be
   resolved: Could not transfer artifact org.beanshell:bsh:jar:2.0b4 from/to centr
  al (http://repo.maven.apache.org/maven2): GET request of: org/beanshell/bsh/2.0b
  4/bsh-2.0b4.jar from central failed
          at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
  solve(DefaultPluginDependenciesResolver.java:208)
          at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPlug
  inRealm(DefaultMavenPluginManager.java:357)
          at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPlugi
  nRealm(DefaultMavenPluginManager.java:325)
          at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(Defa
  ultBuildPluginManager.java:180)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
  BuildPluginManager.java:83)
          ... 20 more
  Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not
  transfer artifact org.beanshell:bsh:jar:2.0b4 from/to central (http://repo.maven
  .apache.org/maven2): GET request of: org/beanshell/bsh/2.0b4/bsh-2.0b4.jar from
  central failed
          at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(Defa
  ultArtifactResolver.java:459)
          at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtif
  acts(DefaultArtifactResolver.java:262)
          at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDepen
  dencies(DefaultRepositorySystem.java:367)
          at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
  solve(DefaultPluginDependenciesResolver.java:200)
          ... 24 more
  Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not tran
  sfer artifact org.beanshell:bsh:jar:2.0b4 from/to central (http://repo.maven.apa
  che.org/maven2): GET request of: org/beanshell/bsh/2.0b4/bsh-2.0b4.jar from cent
  ral failed
          at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(Wa
  gonRepositoryConnector.java:1016)
          at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(Wa
  gonRepositoryConnector.java:1004)
          at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.r
  un(WagonRepositoryConnector.java:725)
          at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(Runn
  ableErrorForwarder.java:67)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
  java:1110)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
  .java:603)
          at java.lang.Thread.run(Thread.java:722)
  Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: org/b
  eanshell/bsh/2.0b4/bsh-2.0b4.jar from central failed
          at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
  49)
          at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
  10)
          at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:2
  87)
          at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:97)
          at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
          at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.r
  un(WagonRepositoryConnector.java:660)
          ... 4 more
  Caused by: java.net.SocketException: Connection reset
          at java.net.SocketInputStream.read(SocketInputStream.java:189)
          at java.net.SocketInputStream.read(SocketInputStream.java:121)
          at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
  ionInputBuffer.read(AbstractSessionInputBuffer.java:204)
          at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengt
  hInputStream.read(ContentLengthInputStream.java:182)
          at org.apache.maven.wagon.providers.http.httpclient.conn.EofSensorInputS
  tream.read(EofSensorInputStream.java:138)
          at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:493)
  
          at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
  39)
          ... 9 more
  [ERROR]
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please rea
  d the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
  onException
  C:\Users\SO310400\workspace\analytics&gt;
  </code></pre>
  
  <p>Since I am using a proxy environment from within my workplace network I have the proxy settings in my C:/Users/MYNAME/.m2/settings.xml (where M2_REPO=C:/Users/MYNAME/.m2/repository) as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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"&gt;
    &lt;proxies&gt;
      &lt;proxy&gt;
        &lt;id&gt;optional&lt;/id&gt;
        &lt;active&gt;true&lt;/active&gt;
        &lt;protocol&gt;http&lt;/protocol&gt;
        &lt;username&gt;MYNAME&lt;/username&gt;
        &lt;password&gt;MYPASSWORD&lt;/password&gt;
        &lt;host&gt;MYPROXYSERVER&lt;/host&gt;
        &lt;port&gt;MYPROXYPORT&lt;/port&gt;
        &lt;nonProxyHosts&gt;google.com&lt;/nonProxyHosts&gt;
      &lt;/proxy&gt;
    &lt;/proxies&gt;
  
  
  &lt;/settings&gt;
  </code></pre>
  
  <p>But I am getting the following error in my project POM (C:/Users/MYNAME/workspace/analytics/pom.xml)</p>
  
  <pre><code>cvc-complex-type.2.4.a: Invalid content was found starting with element 'snapshotRepository'. One of '{"http://
   maven.apache.org/POM/4.0.0":repository}' is expected.
  
  
  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-c
  li of goal org.apache.maven.plugins:maven-archetype-plugin:2.3:generate failed:
  Plugin org.apache.maven.plugins:maven-archetype-plugin:2.3 or one of its depende
  ncies could not be resolved: Could not transfer artifact org.beanshell:bsh:jar:2
  .0b4 from/to central (http://repo.maven.apache.org/maven2): GET request of: org/
  beanshell/bsh/2.0b4/bsh-2.0b4.jar from central failed
  </code></pre>