Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.codehaus.mojo.gwt.shell;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 
Extends the gwt goal and runs the project in the GWT Hosted mode with a debugger port hook (optionally suspended).

Author(s):
cooper
Version:
$Id$
Goal:
debug
Description:
Runs the project with a debugger port hook (optionally suspended).
 
 public class DebugMojo
     extends RunMojo
 {

    
Port to listen for debugger connection on.

Parameter:
default-value="8000" expression="${gwt.debugPort}"
 
     private int debugPort;

    
Whether or not to suspend execution until a debugger connects.

Parameter:
default-value="true" expression="${gwt.debugSuspend}"
 
     private boolean debugSuspend;

    
Attach to the debugger application at the specified debugPort.

Parameter:
default-value="false" expression="${attachDebugger}"
 
     private boolean attachDebugger;

    
 
     @Override
     protected String getFileName()
     {
         return "debug";
     }

    
Override extraJVMArgs to append JVM debugger option

 
     @Override
     public String getExtraJvmArgs()
     {
         String extras = super.getExtraJvmArgs();
         extras += " -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket";
         extras += ",server=" + (  ? "n" : "y" );
         extras += ",address=" + ;
         extras += ",suspend=" + (  ? "y" : "n" );
         return extras;
     }
 
 
     @Override
     public void doExecute()
     {
         if (  )
         {
             getLog().info"starting debugger on port " +  + " in suspend mode" );
         }
         else
         {
             getLog().info"starting debugger on port " +  );
         }
        super.doExecute( );
    }
New to GrepCode? Check out our FAQ X