commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Re: [configuration] Compilation under Java 1.4
Date Wed, 16 Feb 2011 21:48:48 GMT
Hi Oliver,

Oliver Heger wrote:

> Am 16.02.2011 22:05, schrieb Rahul Akolkar:
>> On Wed, Feb 16, 2011 at 3:45 PM, Oliver Heger
>> <oliver.heger@oliver-heger.de>  wrote:
>>> Am 15.02.2011 21:23, schrieb Oliver Heger:
>>>>
>>>> Am 10.02.2011 13:09, schrieb sebb:
>>>>>
>> <snip/>
>>>>>
>>>>> 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.
>>>
>> <snap/>
>>
>> The sources are already compiled using the higher JDK by then (and mvn
>> test won't clean that compile run).
>>
>> -Rahul
>>
> Yes, but I hoped that the excluded classes would not be loaded at all,
> so it would not be a problem that they have been compiled on a higher
> JDK. But obviously surefire works in a different way.

You did not exclude the .class files and forgot the anonymous classes ... 
;-)

Fixed, tests succeed.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message