maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean Tremblay <jean.tremb...@zen-innovations.com>
Subject Executing tests in a newer JVM version than the one used to build project.
Date Thu, 02 May 2013 11:11:10 GMT
Hi,

I have a bit of a complicated setup. I need to build my jar file using java 1.6, but I need
to execute my tests using Java 1.7, as my library need to connect to other libraries built
for Java V1.7.
How can I do that?

I currently set my pom.xml with the following entries:

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
  </properties>



Unfortunately when my test is executed it is also running using v1.6 but I would like to use
version 1.7.

Is there a way to tell sure fire (I guess this is the plugin I should look at) to use v1.7
when executing the tests?
What is exactly choosing the target version of the Java being used for testing?

I develop my project library using eclipse. I have set this project to use java 1.6 for this
eclipse project. If I tell eclipse to use V1.7 my tests are executed in Maven using V1.7 and
then my test are all fine. The problem is then that when I build my jar files there are conflicts
between the java used by eclipse and the java used by Maven, and it can happen that suddenly
the jar file is built with java classes being 1.7 instead of 1.6.

Does anyone have an idea what I should do here?

Thanks for your help.

Jean

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message