Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 317A6104B6 for ; Thu, 2 May 2013 21:12:42 +0000 (UTC) Received: (qmail 7304 invoked by uid 500); 2 May 2013 21:12:40 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 7210 invoked by uid 500); 2 May 2013 21:12:39 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 7201 invoked by uid 99); 2 May 2013 21:12:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2013 21:12:39 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stephen.alan.connolly@gmail.com designates 74.125.82.41 as permitted sender) Received: from [74.125.82.41] (HELO mail-wg0-f41.google.com) (74.125.82.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2013 21:12:33 +0000 Received: by mail-wg0-f41.google.com with SMTP id y10so134752wgg.0 for ; Thu, 02 May 2013 14:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=5IcCkhN2guSeG29nz+5DPHzPviUSvaDTLozM8ALP2yI=; b=0Ga3a0Qaok1jHL4V4ClEwkuvhTVzZPcka1ad0ETpQAOQLzB/LQw/d7nUWZRzvWn+n7 AfE/b2509qKqavyAv2Wf0ACoog1rGWXeJA/Ue5qFozZd+nXk16eRqec9SGnXPTbVijT9 iV/8MD3UsFrJS5V7n4GotbH/fex6Wot0hXpKfAn+sfQOYISPRd558SxRb1d0ntStDbIV 0l0Vs1yH4Dgg5xJ6lhlrsHcH1EzRtUx4Mw6EIAFyy+Lha7nGDZJSPzKND4lb8x6cWFrQ IaryiLQPhyf6KPmPIf4+CWlMjECZtCgKnIIzHIcJuknEkiAWYRCvFK2uMou/rcR9BTWW x0dQ== MIME-Version: 1.0 X-Received: by 10.180.206.204 with SMTP id lq12mr7060345wic.30.1367529133661; Thu, 02 May 2013 14:12:13 -0700 (PDT) Received: by 10.194.37.198 with HTTP; Thu, 2 May 2013 14:12:13 -0700 (PDT) In-Reply-To: <6E3E6895-7480-4A27-8FA8-BF6DF12C6328@zen-innovations.com> References: <6E3E6895-7480-4A27-8FA8-BF6DF12C6328@zen-innovations.com> Date: Thu, 2 May 2013 22:12:13 +0100 Message-ID: Subject: Re: Executing tests in a newer JVM version than the one used to build project. From: Stephen Connolly To: Maven Users List Content-Type: multipart/alternative; boundary=001a11c25cc03b640b04dbc2b046 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c25cc03b640b04dbc2b046 Content-Type: text/plain; charset=ISO-8859-1 On Thursday, 2 May 2013, Jean Tremblay wrote: > 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: > > > UTF-8 > 1.6 > 1.6 > > > > > 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? See my answer here: http://stackoverflow.com/questions/12414209/compile-maven-module-with-different-java-version/12419643#12419643 IIRC you then need to bind a second execution of tool chains after the compile phase but before the test phase to switch to 1.7 > Thanks for your help. > > Jean > -- Sent from my phone --001a11c25cc03b640b04dbc2b046--