diff --git a/jboss/plugin.jelly b/jboss/plugin.jelly
index 0d0ee80d..a106685d 100644
--- a/jboss/plugin.jelly
+++ b/jboss/plugin.jelly
@@ -87,6 +87,7 @@
+
diff --git a/jboss/plugin.properties b/jboss/plugin.properties
index b91d5cc7..ce93aee5 100644
--- a/jboss/plugin.properties
+++ b/jboss/plugin.properties
@@ -77,6 +77,9 @@ maven.jboss.hostname = localhost
# JBoss version
maven.jboss.version=3.2
+# JBoss debug port
+maven.jboss.debug.port=4142
+
# ---------------------------------------------------------------------------
# Note: The properties listed below are only needed for the deploy/undeploy
# goals
diff --git a/jboss/project.xml b/jboss/project.xml
index e2bdbca2..d57b5de8 100644
--- a/jboss/project.xml
+++ b/jboss/project.xml
@@ -23,7 +23,7 @@
3
maven-jboss-plugin
Maven JBoss plugin
- 1.5
+ 1.6-SNAPSHOT
Plugin for JBoss
JBoss plugin
http://maven.apache.org/reference/plugins/jboss/
@@ -65,6 +65,11 @@
1.5
MAVEN_JBOSS_1_5
+
+ 1.6
+ 1.6
+ HEAD
+
diff --git a/jboss/src/plugin-resources/debug b/jboss/src/plugin-resources/debug
new file mode 100644
index 00000000..4247246c
--- /dev/null
+++ b/jboss/src/plugin-resources/debug
@@ -0,0 +1,14 @@
+#! /bin/sh
+# ----------------------------------------------------------------------------
+# Default JBoss start up shell script in debug modes. It calls the default script found
+# in JBOSS_HOME/bin.
+# ----------------------------------------------------------------------------
+export JAVA_OPTS="-Djboss.server.home.dir=@jboss.server.home.dir@ -Djboss.server.home.url=@jboss.server.home.url@ -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=@jboss.server.debug.port@,suspend=n"
+
+#Xrunjdwp... == the info on how to connect to do remote debugging
+#server=y == start in server mode (i.e. wait for connections, don't go out looking to connect
+#transport=dt_socked == use sockets, this works (I think) only on unix (I'm on a mac), on Windows you have to use shared memory via the transport=dt_shmem argument instead. I'm fairly sure this works but its been a while since I tried it on Windows. YMMV. here is the official info on the connection arguments
+#address=4142 == the port to connect to or the shared mem address to use
+#suspend=n == don't wait for a debugger to tell you what to do, go ahead and launch
+
+@maven.jboss.home@/bin/run.sh -c @maven.jboss.conf.name@
diff --git a/jboss/src/plugin-resources/debug.bat b/jboss/src/plugin-resources/debug.bat
new file mode 100644
index 00000000..31ae9819
--- /dev/null
+++ b/jboss/src/plugin-resources/debug.bat
@@ -0,0 +1,32 @@
+@REM ----------------------------------------------------------------------------
+@REM Copyright 2004 The Apache Software Foundation.
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM ----------------------------------------------------------------------------
+@REM
+
+@REM ----------------------------------------------------------------------------
+@REM Default JBoss start up batch script in debug mode. It calls the default script found
+@REM in JBOSS_HOME/bin.
+@REM ----------------------------------------------------------------------------
+@if "%OS%" == "Windows_NT" setlocal
+@set NOPAUSE=true
+@set JAVA_OPTS=-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=@maven.jboss.debug.port@,suspend=n -Djboss.server.home.dir=@jboss.server.home.dir@ -Djboss.server.home.url=@jboss.server.home.url@
+
+@REM Xrunjdwp... == the info on how to connect to do remote debugging
+@REM server=y == start in server mode (i.e. wait for connections, don't go out looking to connect
+@REM transport=dt_socked == use sockets, this works (I think) only on unix (I'm on a mac), on Windows you have to use shared memory via the transport=dt_shmem argument instead. I'm fairly sure this works but its been a while since I tried it on Windows. YMMV. here is the official info on the connection arguments
+@REM address=4142 == the port to connect to or the shared mem address to use
+@REM suspend=n == don't wait for a debugger to tell you what to do, go ahead and launch
+
+@call @maven.jboss.home@\bin\run.bat -c @maven.jboss.conf.name@
diff --git a/jboss/xdocs/changes.xml b/jboss/xdocs/changes.xml
index bc882b93..460bb332 100644
--- a/jboss/xdocs/changes.xml
+++ b/jboss/xdocs/changes.xml
@@ -24,6 +24,12 @@
Vincent Massol
+
+
+ Added new debug scripts that add the -Xdebug and other debugging
+ options to enable remote debugging of a JBoss server.
+
+
Removed trailing white space in default values for the
maven.jboss.jmx.url.deploy.3.2and
diff --git a/jboss/xdocs/properties.xml b/jboss/xdocs/properties.xml
index f80867e4..83678776 100644
--- a/jboss/xdocs/properties.xml
+++ b/jboss/xdocs/properties.xml
@@ -173,6 +173,17 @@
+
+ | maven.jboss.debug.port |
+ Yes |
+
+
+ The port to connect to or the shared mem address to use in
+ the debug scripts. This property
+ defaults to 4142.
+
+ |
+