title: Bulk add all Maven libraries to classpath in IntelliJ
body: <p>I've recently cloned a project and run <code>mvn clean install</code> which has installed all the dependencies listed in my the <code>pom.xml</code>. Whenever I open a class I see a lot of import statements that are trying to import a third party class are highlighted with the error <code>cannot resolve symbol Foo</code>. When I Alt+Enter there is an option to add the library to the classpath which completely resolves the issue - for this library:</p>
  
  <p><a href="https://i.stack.imgur.com/8RVnc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8RVnc.png" alt="enter image description here"></a></p>
  
  <p>This would be fine but I have many libraries I need to do this for. Is there a way I can do this in bulk?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>It's been brought to my attention that I shouldn't have to do this after a <code>mvn clean install</code> if that command completes successfully. As such this is the error I'm getting as the very last part of my logs:</p>
  
  <pre><code>Exception in thread "Thread-9" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
          at org.apache.tomcat.maven.plugin.tomcat7.run.RunMojo$1.run(RunMojo.java:140)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
          at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
          at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
          ... 1 more
  </code></pre>