title: Why are tests failing in my Jenkins-Sonar plugin but not during the Jenkins-Maven run?
body: <p>I'm running Jenkins 1.478 on CentOS, using Java 6, Maven 3.0.4, JUnit 4.8.1 (dependency within the Maven project), and Sonar 3.2.1.  I have my Jenkins Maven 2/3 job setup to run Sonar after it completes (set with goals "clean package -Pdev").  The project is a multi-module project with WAR and EAR modules.  However, when the Sonar portion of the plugin runs, many of the tests die with errors like below …</p>
  
  <pre><code>java.lang.NullPointerException
          at java.util.Properties$LineReader.readLine(Properties.java:418)
          at java.util.Properties.load0(Properties.java:337)
          at java.util.Properties.load(Properties.java:325)
          at org.parentco.myco.client.test.AbstractHibernateDaoTest.loadmyprojectProps(AbstractHibernateDaoTest.java:252)
          at org.parentco.myco.client.test.AbstractHibernateDaoTest.setupMockEjbContainer(AbstractHibernateDaoTest.java:235)
          at org.parentco.myco.client.test.AbstractHibernateDaoTest.setupBeforeClass(AbstractHibernateDaoTest.java:72)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
          at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
          at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
          at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
  </code></pre>
  
  <p>The exception comes from the last line of this code block ...</p>
  
  <pre><code>    final InputStream in = AbstractHibernateDaoTest.class.getClassLoader().getResourceAsStream("myproject.properties");
      final Properties props = new Properties();
      props.load(in);
  </code></pre>
  
  <p>The test runs perfectly during the Maven portion of my job.  The file in question is located at</p>
  
  <pre><code>./myclient-war/src/main/resources/myproject.properties
  </code></pre>
  
  <p>Anyone know how I can troubleshoot this further?  I would prefer to configure something in Sonar as opposed to having to restructure my entire project to accommodate Sonar, but I'm open to suggestions.</p>