title: Intellij can't connect to local m2 repository
body: <h1>Summary</h1>
  
  <p>I've seen a few questions <a href="https://stackoverflow.com/questions/24439818/intellij-cannot-load-sources-from-local-maven-repository">[1]</a> <a href="https://stackoverflow.com/questions/1784132/intellij-community-cant-use-http-proxy-for-maven">[2]</a> <a href="https://stackoverflow.com/questions/30615067/intellij-idea-maven-cannot-reconnect-error">[3]</a> that resemble this somewhat, but none of the answers have produced any sort of success. </p>
  
  <p>So, here are the issues that I am seeing:</p>
  
  <p>1) The pom is indicating that it is not able to connect to the local .m2 repository.</p>
  
  <p>2) The Maven setting in Intellij is showing an error that the connection to the local .m2 repository is refused.</p>
  
  <p><a href="https://i.stack.imgur.com/80vPq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/80vPq.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/89Eb3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/89Eb3.png" alt="Connection to local repository has been refused"></a></p>
  
  <h1>What I have tried so far:</h1>
  
  <p>Pretty much everything in the linked issues. Including:</p>
  
  <p>1) <a href="https://stackoverflow.com/questions/30615067/intellij-idea-maven-cannot-reconnect-error">Delete the entire .m2/repository</a> folder manually, and then update your Maven project again.</p>
  
  <p>2) <a href="https://stackoverflow.com/a/22545214/2600731">Invalidate your Idea cache and restart Idea.</a></p>
  
  <p>3) <a href="https://stackoverflow.com/a/25990530/2600731">increasing Maven's allocated memory</a></p>
  
  <p>4) <a href="https://stackoverflow.com/a/12702961/2600731">Setting localhost to only 127.0.0.1</a></p>
  
  <p>5) <a href="https://stackoverflow.com/a/12702961/2600731">Adding -Djava.net.preferIPv4Stack=true flag</a></p>
  
  <p>6) <a href="https://stackoverflow.com/a/27034877/2600731">Starting Intellij with Java 1.7 instead of 1.8</a></p>
  
  <p>7) Uninstalling and re-installing Maven, Java, and Intellij</p>
  
  <h1>Other information:</h1>
  
  <pre><code>$ java -version
  java version "1.8.0_144"
  Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
  Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
  
  $ echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
  
  $ mvn -version
  Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T12:39:06-07:00)
  Maven home: /usr/local/apache-maven-3.5.0
  Java version: 1.8.0_144, vendor: Oracle Corporation
  Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>
  
  <h1>Idea.log</h1>
  
  <pre><code>2017-08-29 13:16:51,471 [12172337]   WARN -      #org.jetbrains.idea.maven - Failed to update Maven indices for: [local] /Users/donato/.m2/repository 
  org.jetbrains.idea.maven.server.MavenServerIndexerException: Connection refused to host: localhost; nested exception is: 
      java.net.ConnectException: Connection refused (Connection refused)
      at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:221)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)
      at sun.rmi.transport.Transport$1.run(Transport.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
      at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
      at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
      at com.sun.proxy.$Proxy137.updateIndex(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:175)
      at com.intellij.execution.rmi.RemoteUtil.access$300(RemoteUtil.java:36)
      at com.intellij.execution.rmi.RemoteUtil$2$1$1.compute(RemoteUtil.java:156)
      at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:232)
      at com.intellij.execution.rmi.RemoteUtil$2$1.invoke(RemoteUtil.java:153)
      at com.sun.proxy.$Proxy137.updateIndex(Unknown Source)
      at org.jetbrains.idea.maven.server.MavenIndexerWrapper$3.execute(MavenIndexerWrapper.java:120)
      at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:118)
      at org.jetbrains.idea.maven.server.MavenIndexerWrapper.updateIndex(MavenIndexerWrapper.java:115)
      at org.jetbrains.idea.maven.indices.MavenIndex.updateContext(MavenIndex.java:371)
      at org.jetbrains.idea.maven.indices.MavenIndex.updateOrRepair(MavenIndex.java:329)
      at org.jetbrains.idea.maven.indices.MavenIndices.updateOrRepair(MavenIndices.java:128)
      at org.jetbrains.idea.maven.indices.MavenIndicesManager.doUpdateIndices(MavenIndicesManager.java:276)
      at org.jetbrains.idea.maven.indices.MavenIndicesManager.access$200(MavenIndicesManager.java:52)
      at org.jetbrains.idea.maven.indices.MavenIndicesManager$3.run(MavenIndicesManager.java:243)
      at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:718)
      at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:170)
      at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:548)
      at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
      at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
      at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
      at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
      at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:343)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
      java.net.ConnectException: Connection refused (Connection refused)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)
      at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
      at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
      at com.sun.proxy.$Proxy29.setIndeterminate(Unknown Source)
      at org.jetbrains.idea.maven.server.Maven3ServerIndexerImpl.updateIndex(Maven3ServerIndexerImpl.java:152)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
      at sun.rmi.transport.Transport$1.run(Transport.java:200)
      at sun.rmi.transport.Transport$1.run(Transport.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.net.ConnectException: Connection refused (Connection refused)
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at java.net.Socket.connect(Socket.java:538)
      at java.net.Socket.&lt;init&gt;(Socket.java:434)
      at java.net.Socket.&lt;init&gt;(Socket.java:211)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
      ... 24 more
  2017-08-29 13:17:07,836 [12188702]   WARN - ution.rmi.RemoteProcessSupport - java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - java.net.ConnectException: Connection refused (Connection refused) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at com.sun.proxy.$Proxy1.ping(Unknown Source) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at com.intellij.execution.rmi.RemoteServer.start(RemoteServer.java:83) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at org.jetbrains.idea.maven.server.RemoteMavenServer.main(RemoteMavenServer.java:22) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - Caused by: java.net.ConnectException: Connection refused (Connection refused) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at java.net.PlainSocketImpl.socketConnect(Native Method) 
  2017-08-29 13:17:07,841 [12188707]   WARN - ution.rmi.RemoteProcessSupport - at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.Socket.connect(Socket.java:589) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.Socket.connect(Socket.java:538) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.Socket.&lt;init&gt;(Socket.java:434) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at java.net.Socket.&lt;init&gt;(Socket.java:211) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) 
  2017-08-29 13:17:07,842 [12188708]   WARN - ution.rmi.RemoteProcessSupport - ... 8 more 
  2017-08-29 13:17:21,180 [12202046]   INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 34 ms 
  2017-08-29 13:17:23,080 [12203946]   INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED (BUILD PROCESS) 
  2017-08-29 13:17:23,756 [12204622]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /Applications/IntelliJ IDEA CE.app/Contents/lib/jps-launcher.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/tools.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/optimizedFileManager.jar 
  2017-08-29 13:17:23,859 [12204725]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
  2017-08-29 13:17:23,860 [12204726]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation 
  2017-08-29 13:17:23,860 [12204726]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
  2017-08-29 13:17:27,244 [12208110]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
  2017-08-29 13:17:27,299 [12208165]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
  2017-08-29 13:17:27,305 [12208171]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 0ms; general responsiveness: ok; EDT responsiveness: ok 
  2017-08-29 13:17:27,324 [12208190]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update canceled 
  2017-08-29 13:17:27,325 [12208191]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
  2017-08-29 13:17:27,333 [12208199]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok 
  2017-08-29 13:17:27,336 [12208202]   INFO - lij.compiler.impl.CompilerUtil -    COMPILATION FINISHED (BUILD PROCESS); Errors: 100; warnings: 3 took 4150 ms: 0 min 4sec 
  2017-08-29 13:17:27,365 [12208231]   INFO - s.CompilerReferenceServiceImpl - backward reference index reader is opened 
  2017-08-29 13:17:27,369 [12208235]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 36ms; general responsiveness: ok; EDT responsiveness: ok 
  2017-08-29 13:17:27,635 [12208501]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /Applications/IntelliJ IDEA CE.app/Contents/lib/jps-launcher.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/lib/tools.jar:/Applications/IntelliJ IDEA CE.app/Contents/lib/optimizedFileManager.jar 
  2017-08-29 13:17:27,704 [12208570]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
  2017-08-29 13:17:27,704 [12208570]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: Defaulting to no-operation (NOP) logger implementation 
  2017-08-29 13:17:27,704 [12208570]   INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stderr]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
  </code></pre>
  
  <h1>Update</h1>
  
  <p>Which <code>settings.xml</code> are you using? </p>
  
  <p><code>/Users/donato/.m2/settings.xml</code></p>
  
  <p>Does this happen with any Maven project you open in IntelliJ or just this one?</p>
  
  <p>This occurs with all maven projects</p>
  
  <p>Also, apart from Intellij showing indexing failure, does your build work if invoked from the Maven panel?</p>
  
  <p>Build fails, stating that a lot of symbols cannot be found.</p>