Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 52167 invoked from network); 2 Feb 2007 15:10:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Feb 2007 15:10:53 -0000 Received: (qmail 86656 invoked by uid 500); 2 Feb 2007 15:10:46 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 86549 invoked by uid 500); 2 Feb 2007 15:10:46 -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 86490 invoked by uid 99); 2 Feb 2007 15:10:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 07:10:45 -0800 Received-SPF: pass (herse.apache.org: domain of waynefay@gmail.com designates 66.249.92.170 as permitted sender) Received: from [66.249.92.170] (HELO ug-out-1314.google.com) (66.249.92.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Feb 2007 07:10:38 -0800 Received: by ug-out-1314.google.com with SMTP id j40so773516ugd for ; Fri, 02 Feb 2007 07:10:17 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BSgwCrThE4PSq9hLWg5cglDTY71LV2Ew24CpARcflAH8Dtx6vhqI9NEhJnN4w5HLc+PTFMd3n786XczaGcOOLcLXXMM5FOW9/f3sLy/1zBx93XjltgB6hzFIpHivDfbdOljZdgnjuCpju8WFFGo3VDjk8EXbdSLcaU4NR/dB+zc= Received: by 10.82.179.9 with SMTP id b9mr1216159buf.1170429016690; Fri, 02 Feb 2007 07:10:16 -0800 (PST) Received: by 10.82.169.19 with HTTP; Fri, 2 Feb 2007 07:10:16 -0800 (PST) Message-ID: <52bab8690702020710neb90ad9s19767ca07cf88dfa@mail.gmail.com> Date: Fri, 2 Feb 2007 09:10:16 -0600 From: "Wayne Fay" To: "Maven Users List" Subject: Re: Compiling with different configurations for main src and test src In-Reply-To: <02C803D0956FA944872AF133ADA266FE013595D4@mailsvr-emea.na.ad.atg.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <02C803D0956FA944872AF133ADA266FE013595D4@mailsvr-emea.na.ad.atg.com> X-Virus-Checked: Checked by ClamAV on apache.org This is already documented in the Maven User Confluence: http://docs.codehaus.org/display/MAVENUSER/Compile+and+Test+with+Different+JDK+Versions Wayne On 2/2/07, Wiltshire, James wrote: > Hi, > > I'm trying to get maven to compile the main Java source code of a > project using the default configuration of source=1.3, target=1.3, and > then to compile my test source using source=1.5, target=1.5 > > My test source uses JUnit4 annotations, and so needs the JDK 1.5 > compiler. > > > > I can get my entire project to compile with 1.5 using the following > configuration... > > > > > > org.apache.maven.plugins > > maven-compiler-plugin > > > > 1.5 > > 1.5 > > > > > > > > This works fine, however I need my main application source to use JDK1.4 > compatible classes, and the configuration compiles everything as 1.5. > Here's how I'm trying to do it... > > > > > > org.apache.maven.plugins > > maven-compiler-plugin > > > > > > test-compile > > > > 1.5 > > 1.5 > > > > > > testCompile > > > > > > > > > > > > This doesn't work - the test-compile phase complains with errors like > this... > > > > > > "static import declarations are not supported in -source 1.3 (try > -source 1.5 to enable static import declarations)" > > > > Any idea how I can get this compiler configuration to bind to the > test-compile phase of the build? > > > > Thanks in advance. > > James Wiltshire > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org