title: During Maven Build Junit Tests runs fine, but why they fails, if I runs JUnit test manually?
body: <p>I have some problems with my maven project. I have created some JUnit test in my maven folder src/test/java. </p>
  
  <p>If I created my maven project with "mvn clean install" on command line or in Eclipse IDE with the runs configurations like "clean" and "install" all test will be runs fine and don´t occurs some error.</p>
  
  <p>But if I runs the JUnit test manually, one of these Junit test fails. But what is the reason, why maven doesn´t recognized this fact? Here is a code snippet of my maven pom.xml file:</p>
  
  <pre><code>    &lt;plugins&gt;       
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.0.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;optimize&gt;true&lt;/optimize&gt;
                  &lt;fork&gt;true&lt;/fork&gt;
                  &lt;source&gt;${source.jdk}&lt;/source&gt;
                  &lt;target&gt;${target.jdk}&lt;/target&gt;                  
              &lt;/configuration&gt;
          &lt;/plugin&gt;           
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.16&lt;/version&gt;
              &lt;configuration&gt;                
                  &lt;testFailureIgnore&gt;false&lt;/testFailureIgnore&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;           
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;
                          jar-with-dependencies
                      &lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
                  &lt;archive&gt;
                      &lt;addMavenDescriptor&gt;false&lt;/addMavenDescriptor&gt;
                      &lt;manifestEntries&gt;
                          &lt;Source-JDK&gt;${source.jdk}&lt;/Source-JDK&gt;
                          &lt;Target-JDK&gt;${target.jdk}&lt;/Target-JDK&gt;                                      
                          &lt;Project-Build-SourceEncoding&gt;${project.build.sourceEncoding}&lt;/Project-Build-SourceEncoding&gt;    
                          &lt;Maven-Build-Timestamp&gt;${maven.build.timestamp}&lt;/Maven-Build-Timestamp&gt;
                      &lt;/manifestEntries&gt;
                      &lt;manifest&gt;
                          &lt;addDefaultImplementationEntries&gt;true&lt;/addDefaultImplementationEntries&gt;
                          &lt;addDefaultSpecificationEntries&gt;true&lt;/addDefaultSpecificationEntries&gt;
                          &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                          &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
                          &lt;mainClass&gt;${project.groupId}.${project.artifactId}.MainClass&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
                  &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;
                  &lt;classifier&gt;jar-with-dependencies&lt;/classifier&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;assembly-jar-Id&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;single&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>Here is the Junit code which fails:</p>
  
  <pre><code> public void testProperties(){      
  
      String build_time = Parameters.BUILD_TIME.getParameter();
  
      Map&lt;String, String&gt; allProperties = MetaInformation.Properties();       
      for(Map.Entry&lt;String, String&gt; currentEntry : allProperties.entrySet()){
  
          if(currentEntry.getKey().equals(build_time)){               
              String project_build_value = currentEntry.getValue();               
              Assert.assertEquals(true, build_time_value != null &amp;&amp; build_time_value.equals(""));             
          }           
      }
  
  }
  </code></pre>
  
  <p>The Property File includes the following values: </p>
  
  <pre><code>buildTime=${timestamp}
  encoding=${project.build.sourceEncoding}
  </code></pre>
  
  <p>The Junit test, which is reading out the value "buildTime" is failed. "timestamp" is a value, which based on the pom.xml of my maven project. It gives me the the following properties:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;timestamp&gt;${maven.build.timestamp}&lt;/timestamp&gt;
      &lt;maven.build.timestamp.format&gt;dd.MM.yyyy HH:mm&lt;/maven.build.timestamp.format&gt;
  &lt;/properties&gt;   
  </code></pre>
  
  <p>${maven.build.timestamp} represent the point of time, which my maven project was build with the command mvn clean install. The JUnit test, which read this value, makes some trouble since the variable "project_build_value" is empty during execute this JUnit test. But why and how can I solve this problem?</p>