Comments (8)
@bmuschko Well, but you wrote this in one line:
gradle tomcatRun -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
I'm not an expert in Gradle, that's why i came here, and this line misleads me. Anyway, the documentation says that this parameters should be set in GRADLE_OPTS
which is not actually a good way for a few reasons:
- This won't work properly in case of several different Gradle project instances running, since they all will try to listen to the port set in
GRADLE_OPTS
. - This won't work with turned on Gradle Daemon. Since Gradle Daemon is a new JVM instance, those properties don't apply to it. For this case there are
org.gradle.jvmargs=...
. If you set those jvm options via this property, it will work in both Daemon On and Daemon Off ways, because if Daemon is Off, Gradle will anyway see that you've set some properties and fork a new jvm for you (which it will notice you about), and if Daemon is On, this property (containing jvm options) will be applied to the Daemon instance.
By the way, when you use set jvm options via org.gradle.jvmargs=...
you won't see Listening for transport dt_socket at address: 8000
message.
I suggest you mention these points in the documentation.
from gradle-tomcat-plugin.
I don't quite understand.
Why can't you specify needed jvm options in org.gradle.jvmargs
? This options are applied to both the Gradle Daemon (if on) and forked jvm instance, which gradle creates if you specify any org.gradle.jvmargs
with Daemon turned off. And, as per your plugin, tomcat would run inside one of these instances, depending on daemon on/off option, if you specify any org.gradle.jvmargs
.
from gradle-tomcat-plugin.
You should be able to set the same JVM parameters on the command line when you call the Gradle task e.g.
gradle tomcatRun -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
In case that doesn't work let me know. My guess is that you actually want to have two tasks. One for running it normally, one for debugging. That is not supported yet and I'd have to look into. I will leave this ticket open until I have something that you can use. For now the command line parameters should work.
from gradle-tomcat-plugin.
Great point - I didn't think that through at all. Specifying those args on the command line is fine by me.
I'm not going to close the ticket since you said you'd leave it open for now. But using cmd line args works for me.
Thanks!
Jon
from gradle-tomcat-plugin.
I added a section about remote debugging to the FAQ in the README.md.
from gradle-tomcat-plugin.
Command line way doesn't work:
...
- What went wrong:
Problem configuring task :tomcatRun from command line.Unknown command-line option '-X'.
from gradle-tomcat-plugin.
@artemik Minus capital X (-X
) is not a valid command line option for Gradle in general. What exactly are you referring to? If you want to set JVM parameters, you'd have to use a different notation e.g. -Dorg.gradle.jvmargs=-Xdebug
. For more info see Gradle user guide.
from gradle-tomcat-plugin.
Well, but you wrote this in one line.
I was wrong. It happens.
What you really wanted is a forked process that allows you to dedicatedly provide JVM arguments. At the moment the plugin does not provide a forked option. The embedded container runs in the same JVM as Gradle. Please see issue #58 for more details. I'd be happy to integrate a pull request. I am waiting for the community to provide it.
All other questions you have are not necessarily related to this plugin. You'd have the same issue with any other plugin that doesn't work. I'd suggest you ask those questions on the Gradle forum.
from gradle-tomcat-plugin.
Related Issues (20)
- Daemon does not stop HOT 4
- Define which war to use HOT 9
- Gradle Daemon - Caused by: java.lang.Error: factory already defined HOT 2
- Can I tell `TomcatRun` where is the exploded web directory? HOT 1
- Documentation - add example to compile translated jsps HOT 1
- Setting default jsp package name from org.apache.jsp to your choice HOT 2
- Acessing environment variables with the plugin HOT 1
- Gradle 6.2.2 shows deprecation warning regarding jasperAttributes HOT 3
- IllegalArgumentException: The AJP Connector is configured with secretRequired="true" but the secret attribute is either null or "". HOT 7
- How to run the Tomcat server at http://localhost:8080 instead of http://localhost:8080/ProjectName? HOT 2
- Skip Jar Scanning for Annotations HOT 1
- tomcatRun fails with Gradle 7.0 due to @Internal annotation on private getter HOT 11
- 2.6 Release HOT 3
- How to configure environment variables when calling tomcatRun? HOT 1
- Tomcat 10 support
- HTTP2 support
- does this can do like maven tomcat plugin which can build jar not war HOT 1
- Remove usage of WarPluginConvention
- Getting groovy.lang.MissingMethodException after upgrading to tomcat plugin 2.7.0, was using 2.5 before HOT 1
- The AJP Connector is configured with secretRequired="true"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-tomcat-plugin.