title: Powermock driven tests run just fine via maven but don't run in intellij
body: <p>I have a very large project where and at some point developers started noticing that if they try to run/debug a PowerMock driven test in intellij- they get the following error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/powermock/core/transformers/impl/MainMockTransformer
  FATAL ERROR in native method: processing of -javaagent failed
      at org.powermock.modules.agent.PowerMockClassTransformer.&lt;clinit&gt;(PowerMockClassTransformer.java:41)
      at org.powermock.modules.agent.PowerMockAgent.&lt;clinit&gt;(PowerMockAgent.java:42)
      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:497)
      at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
      at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
  Caused by: java.lang.ClassNotFoundException: org.powermock.core.transformers.impl.MainMockTransformer
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 8 more
  </code></pre>
  
  <p>We are using the powermockagent, and a unit test usually looks like this:</p>
  
  <pre><code>@PrepareForTest({Bla.class})
  public class BlaTest {
  
      @Rule
      public PowerMockRule rule = new PowerMockRule();
  
      static {
          PowerMockAgent.initializeIfNeeded();
      }
  
      @Test public void test() { ... }
   }
  </code></pre>
  
  <p>interestingly enough, if I <em>disable</em> dynamic.path, the issue goes away but I consider it a workaround, not a solution since I need the dynamic.path in other scenarios. </p>
  
  <p>Powermock version: 1.6.3 | Junit version: 4.11 | Intellij version: 2016.3</p>
  
  <p>I'll appreciate any insights.</p>