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:20:14 UTC

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

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


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.


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

Posted by "Carl-Eric Menzel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Attachment: toolchains.xml

sample toolchains.xml from my Ubuntu 10.10 machine. Paths probably need to be adjusted for other users. One-time change to the dev environment, probably doesn't need to be touched later.

> 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, toolchains.xml
>
>
> 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.


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

Posted by "Carl-Eric Menzel (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Carl-Eric Menzel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934329#action_12934329 ] 

Carl-Eric Menzel commented on WICKET-3182:
------------------------------------------

Forgot to mention this introduction to maven toolchains: http://maven.apache.org/guides/mini/guide-using-toolchains.html

> 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, toolchains.xml
>
>
> 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.


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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934325#action_12934325 ] 

Martin Grigorov commented on WICKET-3182:
-----------------------------------------

I use my own mvn15 bash script which sets temporary JAVA_HOME and LC_ALL env variables so that Wicket works with non EN locales as well.

> 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
>
> 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.


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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3182.
-------------------------------------

       Resolution: Won't Fix
    Fix Version/s: 1.5-M4
                   1.4.15
         Assignee: Martin Grigorov

After discussion in IRC channel between Igor Vaynberg, Martin Grigorov and Peter Ertl we decided to not use Maven toolchains because this way regular/new users will not be able to build Wicket locally without additional description how to do that.
Thanks for the suggestion!

> 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
>            Assignee: Martin Grigorov
>             Fix For: 1.4.15, 1.5-M4
>
>         Attachments: 0001-introducing-maven-toolchains-plugin-to-make-jdk1.5-c.patch, toolchains.xml
>
>
> 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.


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

Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Thomerson updated WICKET-3182:
-------------------------------------

    Fix Version/s:     (was: 1.4.15)
                       (was: 1.5-M4)

Removing fix versions on things that were marked as fixVersion = (1.4.14 || 1.5-M4), but also weren't fixed (marked "not a problem", "won't fix", etc) so that they don't show up in release notes when in reality they weren't part of the release.

> 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
>            Assignee: Martin Grigorov
>         Attachments: 0001-introducing-maven-toolchains-plugin-to-make-jdk1.5-c.patch, toolchains.xml
>
>
> 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.