Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.12.rc5
    • Fix Version/s: 9.0.0
    • Component/s: Maven
    • Labels:
      None
    • Environment:
      I'm running ant 1.7.0 on Fedora 9.
    • Number of attachments :
      1

      Description

      Following the instructions (http://docs.codehaus.org/display/JETTY/Ant+Jetty+Plugin), I've made jetty launch from my ant build file. I run ant from the command-line, and I see several issues with the jetty/ant integration, although I may well be missing fixes for them:
      1.) The Ant build does not fail if the Jetty server does not launch correctly
      I've seen this if there already is a jetty server listening at the specified port. In this case, the jetty task returns but the ant build ends successfully.

      2.) The jetty server instance is not terminated when the plugin task returns to ant. This causes jetty's termination trace to be mingled with ant's termination trace, which hides ant's termination status. The trace below shows this:
      [echo] ============================================================
      [echo] ============================================================
      [echo] JETTY START-UP FAILED!
      [echo] There already be a Jetty running on the port!
      [echo] Check the log file!"
      [echo] ============================================================
      [echo] ============================================================

      BUILD FAILED
      /home/tony/working_copy/dict11/build.xml:792: JETTY FAILED

      Total time: 8 seconds
      2008-11-17 14:30:38.366::INFO: Shutdown hook executing
      2008-11-17 14:30:38.367:ptweb:INFO: Destroying Spring FrameworkServlet 'main'
      2008-11-17 14:30:38.371:ptweb:INFO: Closing Spring root WebApplicationContext
      2008-11-17 14:30:38.379:ptweb:INFO: Shutting down log4j
      log4j:WARN No appenders could be found for logger (com.mchange.v2.c3p0.impl.NewPooledConnection).
      log4j:WARN Please initialize the log4j system properly.
      2008-11-17 14:30:38.383::INFO: Shutdown hook complete

      I've attached the relevant part of my build file.

        Activity

        Hide
        Jason Porter added a comment -

        I'd like to add the ability to fork the process that starts the server. If I'm using ant as my primary build tool (and not an IDE) then I have to stop the server to recompile / repackage the application. The scanning intervals is great, but it would be very helpful to be able to fork the process (and probably have a jettyStop task as well.

        Show
        Jason Porter added a comment - I'd like to add the ability to fork the process that starts the server. If I'm using ant as my primary build tool (and not an IDE) then I have to stop the server to recompile / repackage the application. The scanning intervals is great, but it would be very helpful to be able to fork the process (and probably have a jettyStop task as well.
        Hide
        Sean Reque added a comment -

        Is there really no way to stop a jetty instance started by the jetty ant task without sending it a SIGKILL? I've wasted far too much time figuring this out and the answer I'm finding so far is no. If one indeed cannot, how could the ant plugin be of practical use to anybody?

        Show
        Sean Reque added a comment - Is there really no way to stop a jetty instance started by the jetty ant task without sending it a SIGKILL? I've wasted far too much time figuring this out and the answer I'm finding so far is no. If one indeed cannot, how could the ant plugin be of practical use to anybody?
        Hide
        Santthosh added a comment -

        I am also really puzzled on how to stop the jetty (started using this plugin) gracefully... hasn't this been thought about in 2 years? Can someone guide me...

        Show
        Santthosh added a comment - I am also really puzzled on how to stop the jetty (started using this plugin) gracefully... hasn't this been thought about in 2 years? Can someone guide me...
        Hide
        Jan Bartel added a comment - - edited

        We will schedule any updates/improvements to jetty-ant for jetty-9, which should be in M0 release soon.

        Jan

        Show
        Jan Bartel added a comment - - edited We will schedule any updates/improvements to jetty-ant for jetty-9, which should be in M0 release soon. Jan
        Hide
        Jan Bartel added a comment -

        Multiple updates done to jetty-ant plugin:

        1. add jetty.stop task
        2. renamed jetty task to jetty.run task
        3. added attribute "daemon" which if true will cause the build to keep executing and jetty to execute in the background (NOT forked)
        4. added stopPort and stopKey attributes to jetty.run to support jetty.stop task
        5. added contextXml attribute to apply a context xml file to configure the webapp
        6. changed webApp element to be a WebAppContext instance so attributes now are the setter methods from that class
        7. works with jsp 2.2

        Opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=396012 to remind myself to document changes for jetty-9.

        If there is interest in haveing a version that forks jetty in a new process, please open a new bug at Eclipse here: https://bugs.eclipse.org/bugs/buglist.cgi?cmdtype=runnamed&namedcmd=jetty-bugs&list_id=3781522

        as jira is closed for new bugs.

        thanks
        Jan

        Show
        Jan Bartel added a comment - Multiple updates done to jetty-ant plugin: 1. add jetty.stop task 2. renamed jetty task to jetty.run task 3. added attribute "daemon" which if true will cause the build to keep executing and jetty to execute in the background (NOT forked) 4. added stopPort and stopKey attributes to jetty.run to support jetty.stop task 5. added contextXml attribute to apply a context xml file to configure the webapp 6. changed webApp element to be a WebAppContext instance so attributes now are the setter methods from that class 7. works with jsp 2.2 Opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=396012 to remind myself to document changes for jetty-9. If there is interest in haveing a version that forks jetty in a new process, please open a new bug at Eclipse here: https://bugs.eclipse.org/bugs/buglist.cgi?cmdtype=runnamed&namedcmd=jetty-bugs&list_id=3781522 as jira is closed for new bugs. thanks Jan

          People

          • Assignee:
            Jan Bartel
            Reporter:
            Tony Strauss
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: