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 D5D67CAEB for ; Tue, 25 Jun 2013 10:02:42 +0000 (UTC) Received: (qmail 21348 invoked by uid 500); 25 Jun 2013 10:02:40 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 21073 invoked by uid 500); 25 Jun 2013 10:02:38 -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 21065 invoked by uid 99); 25 Jun 2013 10:02:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 10:02:37 +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 (athena.apache.org: domain of bmathus@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ea0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jun 2013 10:02:33 +0000 Received: by mail-ea0-f172.google.com with SMTP id q10so6620829eaj.17 for ; Tue, 25 Jun 2013 03:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=/rgi2I5itNN6+hXZSanGJv8BFN0wM86is3lAqTQzLAg=; b=Z7C+NpnVwdsuMXb8Uo29Qyv02WLsv+GqWQ26i7bpB2hzL1IWUmDwgTCDBo0fEHxfJb JunbmIH5Vauclqn3sTVIiycHInheT/Tzv2zXLqxyfmes1V6KduKladAUYeOqgqZn47SB 8hBDEs9yLXiZqVo3ao9fpyQFpr6VEnMoxMs0asLGLRStM4D9VEBpAS6mY5BNEkUWCHEr wy+MAOsgMrLhafNU4vvHObX+W6W1JvoDpRMydSWYBDs9pNsbAQfmFUubmsGIV2lEo2us KwJtVnVUtd15adI1hwjdM5Jxe77IqScfLUdEgJMr+fzU7+h4AlyHeoouecfUZ96zIptD L96w== X-Received: by 10.15.64.202 with SMTP id o50mr29088440eex.44.1372154532456; Tue, 25 Jun 2013 03:02:12 -0700 (PDT) MIME-Version: 1.0 Sender: bmathus@gmail.com Received: by 10.14.91.130 with HTTP; Tue, 25 Jun 2013 03:01:52 -0700 (PDT) In-Reply-To: References: <51C93583.70508@artifact-software.com> From: Baptiste MATHUS Date: Tue, 25 Jun 2013 12:01:52 +0200 X-Google-Sender-Auth: YuIc6O36-lQ8yW05FjeoKymbwBY Message-ID: Subject: Re: Multiple JDK versions To: Maven Users List Content-Type: multipart/alternative; boundary=001a11c3dcca7c146204dff79f61 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3dcca7c146204dff79f61 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Well, if you have multiple customers, some on 1.5, some on 1.6, then just release a 1.5 version. It will work perfectly with both 1.5 AND 1.6. Please note this is actually what you certainly are already doing with a lot of dependencies in your classpath. Not all have the same bytecode version. What you might just want to do that is running some integration tests on your project. To do that, you'd just need to execute the corresponding tests with some CI environment (like Jenkins, to illustrate/be clear). About your question for source and target parameters, please note this is actually something related to javac, not the maven-compiler-plugin. See http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/javac.html To sum up: * source is asking the compiler you're not using things of upper jdk in your *source* code * target is asking the compiler to generated bytecode that will run on the specified JRE (minimum). Cheers 2013/6/25 virg g <06virg@gmail.com> > Yes. We have multiple customers, some of them support 1.5 and others 1.6. > We need to release both the builds with 1.5 and 1.6. Right now i am > initiating build separately one after the other, setting JAVA_HOME > correctly and passing jdk-version according build i need, this parameter = i > am setting for both source and target. Sending both the parameters > JAVA_HOME, jdk-versions(1.5 to 1.6 to set source and target) is kind of > duplicate and also we need to ensure that both are in parameters Sync and > should match, should be not any mistakes. > Looking for right solution. As you suggested matrix build, i will check. > Any other best solutions? > > This is plugin i am using > > org.apache.maven.plugins > maven-compiler-plugin > 2.5.1 > > ${jdk-version} > ${jdk-version} > ${project.build.sourceEncoding} > ${JAVA_HOME}/bin/javac > > > > > true > > > > Thanks > Virg > > > On Tue, Jun 25, 2013 at 12:39 PM, Baptiste MATHUS wrote: > > > Hi, > > +1 on the question, do you really need to build for both versions? As J= DK > > is backward compatible, you could for example build only with 1.5. > > > > Maybe you only want to test your build on a 1.5 and 1.6, then I > personally > > would prefer keeping a quite simple build and keep those combinations o= n > > some CI server like jenkins (see matrix build in this case). > > > > Cheers > > Le 25 juin 2013 08:16, "Ron Wheeler" a > > =C3=A9crit : > > > > > Why do you need to compile with 2 versions? > > > You can run apps compiled with 1.5 under 1.6. > > > > > > I am not sure that the value of JAVA_HOME has any effect on compiling= . > > > Check the settings in the compile plug-in. > > > > > > Ron > > > > > > > > > On 25/06/2013 1:59 AM, virg g wrote: > > > > > >> Hi, I need build my project with multiple jdk versions 1.5 and 1.6.= I > > >> > > > > am using maven compiler plugin to set the compiler based on JAVA_HO= ME > > > > set. Is it mandatory to set target either 1.5 or 1.6 based on the j= dk > > > > version i want to build. Why because if i set compiler to jdk 1.6, = in > > > > the debug log it shows that target is 1.5 but it should be 1.6 righ= t? > > > > target should set automatically based on JAVA_HOME right unless i > > > > specically mention the target if i want to change? Any pointers for > > > > my problem? > > > > > > > > [DEBUG] (f) executable =3D D:/jdk1.6.0_14/bin/javac [DEBUG] (f) > > > > source =3D 1.5 [DEBUG] (f) staleMillis =3D 0 [DEBUG] (f) target= =3D > > > > 1.5 > > > > > > > > Thanks virg > > > > > > > > > > > > > -- > > > Ron Wheeler > > > President > > > Artifact Software Inc > > > email: rwheeler@artifact-software.com > > > skype: ronaldmwheeler > > > phone: 866-970-2435, ext 102 > > > > > > > > > > -- > Baptiste MATHUS - http://batmat.net > Sauvez un arbre, > Mangez un castor ! nbsp;! > --001a11c3dcca7c146204dff79f61--