You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (JIRA)" <ji...@apache.org> on 2010/11/21 19:30:13 UTC

[jira] Updated: (WICKET-3182) Introduce Maven Toolchains to ensure compilation with an appropriate JDK

     [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl-Eric Menzel updated WICKET-3182:
-------------------------------------

    Attachment: 0001-introducing-maven-toolchains-plugin-to-make-jdk1.5-c.patch

Patch against Wicket 1.4.13 that introduces maven-toolchains and configures it for JDK version 1.5, so that the build will be compiled with an actual 1.5 JDK, not just syntax compatibility.

> Introduce Maven Toolchains to ensure compilation with an appropriate JDK
> ------------------------------------------------------------------------
>
>                 Key: WICKET-3182
>                 URL: https://issues.apache.org/jira/browse/WICKET-3182
>             Project: Wicket
>          Issue Type: Improvement
>    Affects Versions: 1.4.13
>            Reporter: Carl-Eric Menzel
>         Attachments: 0001-introducing-maven-toolchains-plugin-to-make-jdk1.5-c.patch
>
>
> Trying to compile Wicket 1.4.13 recently, I ran into the problem that ResourceTestPage in wicket-threadtest failed to compile, since it tries to catch an IOException in line 87. The only line in the catch block, JPEGImageEncoder.encode(image), doesn't declare that exception, and so the compiler rejects the catch.
> Turns out this is a change in JDK 1.6. After pulling in some old Ubuntu repositories and actually installing an old 1.5 JDK, and temporarily setting my JAVA_HOME to that, the build worked fine.
> It would be easy to just change this catch clause to Throwable instead of IOException, that way both JDKs would be satisfied. However, when I hack on Wicket, I don't want to inadvertently introduce dependencies to JDK 1.6. The maven compiler settings only check for syntax compatibility, not API compatibility, so this could easily happen.
> On the other hand, I don't want to be setting and re-setting my JAVA_HOME every time I want to build Wicket, so I looked for a way to tell Maven what JDK to use, without hardcoding my path into Wicket's pom.xml.
> It turns out that you can't do anything like that in your local settings.xml. Sometimes I really hate Maven ;-)
> There is a plugin called maven-toolchains, however, that makes this possible. You add this plugin to the projects, and add a rather simply toolchains.xml to your ~/.m2/, and then you can define things like "JDK version: 1.5" or even "vendor: sun". I wouldn't do the latter, but I found that this way I could have Maven automatically pick my JDK 1.5 installation for Wicket, and compile everything else with 1.6.
> I'll provide a patch and an example toolchains.xml. What do you think, should this be integrated? It would amount to a one-time change to each developer's environment (at least for those that don't use toolchains yet).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.