Giter VIP home page Giter VIP logo

Comments (8)

artemik avatar artemik commented on May 18, 2024 2

@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:

  1. 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.
  2. 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.

artemik avatar artemik commented on May 18, 2024 1

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.

bmuschko avatar bmuschko commented on May 18, 2024

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.

jonchase avatar jonchase commented on May 18, 2024

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.

bmuschko avatar bmuschko commented on May 18, 2024

I added a section about remote debugging to the FAQ in the README.md.

from gradle-tomcat-plugin.

artemik avatar artemik commented on May 18, 2024

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.

bmuschko avatar bmuschko commented on May 18, 2024

@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.

bmuschko avatar bmuschko commented on May 18, 2024

@artemik

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.