From dev-return-124046-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Wed Feb 16 20:45:50 2011 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 14511 invoked from network); 16 Feb 2011 20:45:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2011 20:45:49 -0000 Received: (qmail 19871 invoked by uid 500); 16 Feb 2011 20:45:49 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 19682 invoked by uid 500); 16 Feb 2011 20:45:48 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 19674 invoked by uid 99); 16 Feb 2011 20:45:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 20:45:47 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [212.227.17.9] (HELO moutng.kundenserver.de) (212.227.17.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 20:45:39 +0000 Received: from [192.168.178.20] (trir-4d0d95bf.pool.mediaWays.net [77.13.149.191]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LtlI5-1QFY8x2BaH-010s7A; Wed, 16 Feb 2011 21:45:19 +0100 Message-ID: <4D5C3757.7000800@oliver-heger.de> Date: Wed, 16 Feb 2011 21:45:11 +0100 From: Oliver Heger User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Commons Developers List Subject: Re: [configuration] Compilation under Java 1.4 References: <4D53063E.5060104@oliver-heger.de> <23686F0A-ACF5-40B1-A45F-29B7D21CC789@dslextreme.com> <4D538DE3.1060909@oliver-heger.de> <7DE14A4D-AF8A-4C67-8E63-2E0CAE7CA6A6@dslextreme.com> <4D5AE0CD.5060604@oliver-heger.de> In-Reply-To: <4D5AE0CD.5060604@oliver-heger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:8iGp5QG7qiT9c7Op04S7Iy7BSWSte26g4UTekTmYPQo vnMZqSq0TWUiIXF8C37orw7ePnLTP48+HgnOv+3iNYISxOGehJ HqeE3+P5rx1yPS5Xbabk9ObTJsafmrN13vVA1fqF0hzAruOnQe rgzQws5FnDgw6yIGA1Wdk7+ehusFXmDjCVGNXFnEmBK1pDBLh3 vP8E8M+QPc7yk465kykqg== X-Virus-Checked: Checked by ClamAV on apache.org Am 15.02.2011 21:23, schrieb Oliver Heger: > Am 10.02.2011 13:09, schrieb sebb: >> On 10 February 2011 07:27, Ralph Goers wrote: >>> >>> On Feb 9, 2011, at 11:04 PM, Oliver Heger wrote: >>> >>>> Am 10.02.2011 00:48, schrieb Ralph Goers: >>>>> >>>>> On Feb 9, 2011, at 2:54 PM, Jörg Schaible wrote: >>>>> >>>>>> Hi Ralph, >>>>>> >>>>>> Ralph Goers wrote: >>>>>> >>>>>>> The latest versions of Maven require JDK 1.5. The pom (or the >>>>>>> Commons >>>>>>> Parent) should be specifying that the target for Commons >>>>>>> Configuration is >>>>>>> 1.4. I've run this build many times successfully (I use 1.6). I >>>>>>> don't >>>>>>> see any problem requiring the build to use Maven 2.2.x or Maven 3 >>>>>>> and/or >>>>>>> have a minimum JDK version for that. I would have a problem if this >>>>>>> prevented the result from running in a JDK 1.4 VM. >>>>>> >>>>>> but this is what Oliver told: vfs snapshot was compiled with >>>>>> target 1.5, so >>>>>> you cannot compile and run with a target 1.4. >>>>> >>>>> I just did an svn up on both vfs and configuration and then did a >>>>> mvn clean install on each. Both build and run their unit tests with >>>>> no problems. >>>>> >>>>> I believe this problem only exists when you build using JDK 1.4, >>>>> which is also the way I read Oliver's message. >>>>> >>>>> Ralph >>>>> >>>> Yes, building on a JDK 1.4 is no more possible (builds on JDK 1.5+ >>>> work without problems). This is a bit strange as we still target >>>> this version. I prefer building on the target JDK because otherwise >>>> it is easy to introduce incompatibilities, e.g. by using library >>>> classes or methods available only on higher JDKs. >>>> >>>> So in any case to ensure compatibility, it would be necessary to run >>>> at least the tests on a 1.4 runtime. How can we do this with the >>>> least effort? Can this be done with maven or do we need an ant script? >>>> >>>> The generated configuration jar should still be compatible with 1.4, >>>> but if you use classes depending on vfs, you will of course need a >>>> 1.5 runtime. >>> >>> It should be possible to create a profile that excludes the unit >>> tests that use VFS if the jdk is 1.4. If the code has already been >>> compiled then running mvn test with maven 2.0.x and jdk 1.4 should >>> work since it won't try to compile anything. >> >> FYI: >> >> Note that the Commons Parent POM was changed some while ago to add >> profiles java-1.4, java-1.3 etc. which change the Java version used >> for compile and test without needing to change the JVM used to run >> Maven itself. >> >> See >> http://commons.apache.org/commons-parent-pom.html#Testing_with_different_Java_versions >> > > Thanks for the pointer. I will try to exclude the affected classes if > the profile for Java 1.4 is active. > Just an update: I have added a profile which excludes the problematic classes when building under JDK 1.4. With the current version of the pom it is possible to run the following command successfully: mvn clean package -Pjava-1.4 However, what does not work is the following: If you first build without the profile (using Java 1.5+), you cannot simply run mvn test -Pjava-1.4 (i.e. simply running tests without compiling). Test execution is aborted immediately with a bad class version error, although I excluded the classes in the configuration of the surefire plug-in. No idea why this is the case. Oliver > Oliver > >> >>> Ralph >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >>> For additional commands, e-mail: dev-help@commons.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org