I am currently unable to debug an application that uses gradle + dropwizard from IntelliJ IDEA
I imported the project using the JetGradle plugin and I am launching the "run" task in debug mode from the plugin itself.
I am using this sample project:
https://github.com/quad/dropwizard-gradle
The project actually runs but the breakpoints are never hit.
Anything I may be missing that prevents me from debugging this simple app from IntelliJ ?
There could be many reasons why the debugger isn't stopping at a breakpoint, and from your description it's unclear if the problem is related to (Jet)Gradle. That said, the JetGradle plugin in IDEA 12 is very limited, and I recommend to use Gradle's idea plugin instead. Alternatively, try an early access preview of IDEA 13, which has a much improved Gradle integration.
Related
I am trying to debug my grails 3.3.11 source code using a community version of IntelliJ Idea. I don't know why but, even if a choose a break point, I run the command
grails run-app -debug
as I have seen in a variety of sites, the application never stops in the breakpoint. It executes all the program.
I have two questions.
1 - Is it possible to debug a grails 3.3.11 project using the community version of IntelliJ Idea?
2 - If so, how can I do that.
Thanks,
Alfredo
I have two questions. 1 - Is it possible to debug a grails 3.3.11 project using the community version of IntelliJ Idea?
Yes. The debugger in the community version of Intellij works well with Grails.
2 - If so, how can I do that.
There are a number of ways. You can create a run-configuration in IntelliJ to launch the application in debug mode. You can launch the application using ./gradlew bootRun --debug-jvm and then attach a remote debugger from the IDE (I do that all the time). The video at https://grails.org/blog/2017-01-20-4.html demonstrates using the debugger (that portion works the same in Community Edition vs Ultimate Edition).
I just set up JRebel to use with my Spring web app in IntelliJ, and was very surprised to learn that I have to manually rebuild the project/recompile every time I want my changes to be reflected. Doesn't this defeat the whole purpose of JRebel? Is there something I'm missing here? With Eclipse it was nearly instant, make changes anywhere, save, instantly reflected in running app. With IntelliJ the process seems very clunky. Am I missing something here?
Running with JRebel in IntelliJ involves starting your application using Run > Run with JRebel and when you change your application code you have to build the project in order for IntelliJ to compile classes and update your application.
You can do this by running SHIFT + F9 or Build > Build Project
From the JRebel docs:
JRebel relies upon your IDE to do the compiling. JRebel reloads your compiled .class files and not your .java files. When you change code, JRebel pushes the changed classes and resources to the server without redeploying.
Regardless of what IDE you use, JRebel still needs the IDE to compile the classes before it can update the running application. IntelliJ is no different to Eclipse in this regard. Perhaps Eclipse was just auto building the project without you being aware of it. You can also instruct IntelliJ to auto build from Preferences > Build, Execution, Deployment > Compiler > Build project automatically.
Here's a screenshot showing that configuration setting:
I have a groovy project in IntelliJ Ultimate 2017.1.5 based on gradle. I'm using groovy 2.4.4. My IDEA is set up to run gradle with gradle 4.0.2.
Gradle 'webclient' project refresh failed
Error:No such property: from for class: org.gradle.api.internal.tasks.DefaultTaskOutputs$TaskOutputUnionFileCollection
Unfortunately, nothing in IntelliJ tells me where this error comes from. All I know is, from the package name, that it has to do with gradle. This IDE is seemingly really unhelpful. It either works, which is rarely, and when it doesn't work, doesn't give you much error reporting.
I found a work-around. If I add
apply plugin: 'idea'
To the top of my module's build.gradle
and run
./gradlew idea
It downloads my dependencies in to the right place (where, IDK, but it works - im guessing IDEA knows how to find my local ~/.gradle repo).
But refreshing the project from the UI still fails. It would be nice of IntelliJ told you what it's doing. I don't know why they want to hide everything it's doing, when the system is so brittle and breakable.
I'm facing difficulties in setting up a gradle project. During setting up of the Gradle settings in the wizard,
I am not able to use the default recommended gradle wrapper because it downloads the Gradle and the network connectivity is very bad. So I go with the local gradle distribution which I have installed in my Ubuntu. On refreshing of the gradle project after creation, I always get stuck to this error. When I run the gradle build command through the terminal on the empty project, It works fine.
I have also tried the troubleshooting solutions given by the IDE. But, that made no improvements. Need assistance to solve this problem.
Comment if any additional info required.
As no-one else has chipped in, an approach that should work is to use the Gradle Idea Plugin instead of relying on the build in support Gradle in Idea. In my experience the plugin supports a wider range of Gradle project structures than Ideasupports directly. So you would
Create a Gradle project outside Idea and confirm it all works on from the command line.
Add the Idea plugin to the project
Run 'gradle cleanIdea idea' to generate the Idea project files.
Open up the newly generated project files from Idea and off you go.
I am trying to build a project with gradle from within Intellij Idea 12 (commercial editon) but this keeps failing. I have the gradle plugin enabled and also the gradle gui plugin. The native project gradle import is working. (I'm not using gradle idea btw.)
When using the bash I only run gradle war to build my web application. Now I want to do the same from within Intellij.
The gradle gui plugin seems to be using the wrong JDK (I guess it's the one Idea uses, a 1.6 JDK) and therefor fails to compile because this is a JDK 1.7 project. And it doesn't integrate well into Idea because it seems like an external build process (like triggering external ant tasks).
What I have done so far is to configure my own artifact in a way that is equivalent to the one gradle war would have build. But that means a lot of configuration and simply feels wrong. There should be a better way?
So what do I have to do to make Idea compile a project in a way similar to the command line gradle task?
JetGradle plugin doesn't provide native tasks support at the moment. It's scheduled for v.12.1 - IDEA-95897. Feel free to track the plugin's news and update it manually as soon as corresponding support is provided.