title: Is it possible to recompile jar targeting different version?
body: <p>I want to use a jar in my Android application which is compiled with <strong>Maven</strong>.
  The problem is that the jar is compiled targeting 1.8 Java, when Android needs 1.7 or lower.</p>
  
  <p>I have the jar file along with source files. Below you can see the directory of the source files of the library:</p>
  
  <pre><code>C:.
  |   pom.xml
  |   sonar-project.properties
  |   
  +---.sonar
  |   \---.sonartmp
  |       \---caches
  +---src
  |   +---main
  |   |   +---java
  |   |   |   \---(folder with source java files)
  |   |   |                       
  |   |   \---resources
  |   |           logback.xml
  |   |           
  |   \---test
  |       \---(folder with java files)
  |                               
  \---target
      |   OLDJAR.jar
      |   
      +---classes
      |   |   .netbeans_automatic_build
      |   |   logback.xml
      |   |   
      |   \---(folder with class files)
      |                       
      +---generated-sources
      |   +---annotations
      |   \---test-annotations
      +---javadoc-bundle-options
      |       javadoc-options-javadoc-resources.xml
      |       package-list
      |       
      +---maven-archiver
      |       pom.properties
      |       
      +---site
      |   \---(folder with Htmls)
      |                               
      \---test-classes
          |   .netbeans_automatic_build
          |   
          \---(class files)
  </code></pre>
  
  <p>Since I am new to Maven, I would really appreciate some help here. How can I make a new jar targeting this time 1.7 version?</p>
  
  <p>I have modified the pom.xml file to target 1.7:</p>
  
  <pre><code>    &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.3.2&lt;/version&gt;
          &lt;configuration&gt;
              &lt;source&gt;1.7&lt;/source&gt;
              &lt;target&gt;1.7&lt;/target&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p>I want to know what is the proper way to recompile this into a jar. I tried 
  <code>mvn clean install</code> but I got some test failures. Am I missing something?</p>
  
  <p>EDIT: When I try <code>mvn clean install</code> I get the following error:</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 8.677 s
  [INFO] Finished at: 2015-11-23T14:20:25+02:00
  [INFO] Final Memory: 23M/400M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project Project: There are test failures.
  [ERROR] 
  [ERROR] Please refer to surefire-reports for the individual test results.
  [ERROR] -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  </code></pre>
  
  <p>Thanks..</p>