Velocity
  1. Velocity
  2. VELOCITY-521

please do not force to use JDK 1.4 for running the package target in build.xml

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6
    • Component/s: Build
    • Labels:
      None
    • Environment:
      all

      Description

      build.xml target package forces to use exactly JDK 1.4.
      Would it not be better to build with target=1.4, source=1.4 and to simply check that the JDK version is >= 1.4
      I will attach a patch to this effect.

      Regards,

      Antoine

      1. patch.txt
        2 kB
        Antoine Levy-Lambert

        Activity

        Hide
        Will Glass-Husain added a comment -

        Henning changed the build file a while ago. I added a note to the wiki, and also set the target and source javac options to 1.4 as Antoine suggested.

        Show
        Will Glass-Husain added a comment - Henning changed the build file a while ago. I added a note to the wiki, and also set the target and source javac options to 1.4 as Antoine suggested.
        Hide
        Will Glass-Husain added a comment -

        ok, I'll pull it out. it seemed like a good idea at the time. I'd assumed that "ant dist" was only used by the release manager.

        Show
        Will Glass-Husain added a comment - ok, I'll pull it out. it seemed like a good idea at the time. I'd assumed that "ant dist" was only used by the release manager.
        Hide
        Henning Schmiedehausen added a comment -

        Enforcing the version of the compiler might be good to catch errors on the release manager side, however it makes a PITA for anyone that wants to build the release for internal purposes. There are good reasons (we actually recommend it in the README IIRC) to rebuild with 1.3 if you are stuck in a legacy environment.

        I'd suggest to back that patch out from build.xml and add an internal, non-commented (so that it does not show up in "ant -p") target, e.g. dist-package, that is used by the release manager to build the distribution.

        I also would like to see this clearly documented in the velocity docs.

        That is the kind of "last minute rush" patches, that I did want to avoid. That patch should IMHO not have been in the 1.5 release, that would have been good for 1.5.1 or 1.6

        Show
        Henning Schmiedehausen added a comment - Enforcing the version of the compiler might be good to catch errors on the release manager side, however it makes a PITA for anyone that wants to build the release for internal purposes. There are good reasons (we actually recommend it in the README IIRC) to rebuild with 1.3 if you are stuck in a legacy environment. I'd suggest to back that patch out from build.xml and add an internal, non-commented (so that it does not show up in "ant -p") target, e.g. dist-package, that is used by the release manager to build the distribution. I also would like to see this clearly documented in the velocity docs. That is the kind of "last minute rush" patches, that I did want to avoid. That patch should IMHO not have been in the 1.5 release, that would have been good for 1.5.1 or 1.6
        Hide
        Antoine Levy-Lambert added a comment -

        Hello Will,

        As an indication, Ant 1.7.0 has been built under JDK 1.5 with source and target 1.2.
        It runs perfectly under JDK 1.4. I am not sure whether we have had to change our code for 1.3 to make method calls go to the right JDK method. Ant does not run under 1.2 any more, but this is due to our implementation, not to compilation.

        See these postings concerning the risks of compiling under 1.5

        http://article.gmane.org/gmane.comp.jakarta.ant.devel/44616/
        http://article.gmane.org/gmane.comp.jakarta.ant.devel/44751/

        Show
        Antoine Levy-Lambert added a comment - Hello Will, As an indication, Ant 1.7.0 has been built under JDK 1.5 with source and target 1.2. It runs perfectly under JDK 1.4. I am not sure whether we have had to change our code for 1.3 to make method calls go to the right JDK method. Ant does not run under 1.2 any more, but this is due to our implementation, not to compilation. See these postings concerning the risks of compiling under 1.5 http://article.gmane.org/gmane.comp.jakarta.ant.devel/44616/ http://article.gmane.org/gmane.comp.jakarta.ant.devel/44751/
        Hide
        Will Glass-Husain added a comment -

        Gump runs the package target? I hadn't realized that. I thought we only ran this for creating final distributions. Thanks for catching this.

        Does it really work to set target=1.4, source=1.4 and have the resulting jar work with JDK 1.3, 1.4, 1.5 no matter which JDK you compile with?

        Show
        Will Glass-Husain added a comment - Gump runs the package target? I hadn't realized that. I thought we only ran this for creating final distributions. Thanks for catching this. Does it really work to set target=1.4, source=1.4 and have the resulting jar work with JDK 1.3, 1.4, 1.5 no matter which JDK you compile with?
        Hide
        Antoine Levy-Lambert added a comment -

        I create this issue because velocity-engine stopped building in gump due to the strict JDK=1.4 restriction.
        I found a workaround for gump by setting correct-java-version=true in the gump descriptor.
        The solution proposed here is similar to the build of ant, where we build with source and target 1.2.

        Show
        Antoine Levy-Lambert added a comment - I create this issue because velocity-engine stopped building in gump due to the strict JDK=1.4 restriction. I found a workaround for gump by setting correct-java-version=true in the gump descriptor. The solution proposed here is similar to the build of ant, where we build with source and target 1.2.

          People

          • Assignee:
            Will Glass-Husain
            Reporter:
            Antoine Levy-Lambert
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development