I deleted gradle files like gradlew, wrapper etc except of the gradle.build.kts from the Intellij IDEA project.
But the IDEA keeps adding it back, how to prevent that? I don't want those files.
IDE creates it when you are using Gradle wrapper for project.
If you do not want to use Gradle wrapper, you can set the local Gradle distribution in Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Use Gradle from option.
Related
I have a project I want to share with my team including IntelliJ setup. The project requires several IntelliJ plugins for convenient work. How can I share plugin setup with my team easily, so they don't need to install plugins one-by-one?
Use the Required Plugins setting (Preferences | Build, Execution, Deployment | Required Plugins). Here you can specify plugins required for your project. When the project is opened and a required plugin is not installed, a warning will show with a link to download the plugin.
I have a local sbt installed with a higher version. But the IntellIJ downloads a lower version of the sbt.
How/where can I update the path in the IntellIJ so that it takes up the newer version of sbt?
Have you tried the settings?
Preferences
⇒ Build, Execution, Deployment
⇒ Build Tools
⇒ SBT
⇒ Launcher (sbt-launch.jar)
⇒ Custom
IntelliJ will use a built-in launcher which may be out of date, but the launcher automatically downloads a newer version of sbt if it is configured in your project's project/build.properties file, adding a line like this:
sbt.version=0.13.11
You can also choose a custom launcher binary in the Preferences: Build, Execution, Deployment / Build Tools / SBT
Preferences | Build, Execution, Deployment | Build Tools | SBT |
Launcher (sbt-launch.sbt)
As shown below:
Is there a way to visualize project dependencies for a gradle project in Intellij? For a maven project, if you right click in the pom.xml you get a Show dependencies option but there I don't see such an option for a gradle project.
Does this feature exist for gradle project?
I did a small search in IDEA and Google and looks like there is not way to see Gradle dependency but I have found the plugin "Gradle View" which does what you need
http://plugins.jetbrains.com/plugin/7150
You can open a ticket and maybe they will add a better Gradle support in IDEA 15
I'm working on multiple Gradle projects with internal and external dependencies, and so far I am happy that thanks to Gradle's dependency management I can modify a library project without affecting every application that uses the library.
When I need to modify a library project and test it using an application project that uses it, I need to do the following,
Modify the library project and commit to SCM
Trigger CI to build the library project and push it to my Gradle repository
Update the application project's build.properties to refer to the new version of library project
Iterate the above steps until everything works and there is no bug
So it became quite combersome now. Can I configure IntelliJ IDEA so that
All my Gradle projects are in one window, like the screenshot below, which is Twitter's Finagle imported using its pom.xml. Sadly IntelliJ's JetGradle plugin doesn't seem to understand Gradle subprojects.
When build.properties's dependencies are my subprojects, read dependency from local snapshot, otherwise download them from the Gradle repository
Thanks.
If you want to open all projects in a single IDEA window, you'll have to aggregate them into a multi-project build, at least until IDEA 13 hits the market. Before IDEA 13, it's better to use Gradle's IDEA integration. Once you have a multi-project build, all you need to do is to add allprojects { apply plugin: "idea" } to the root build script, run gradle (cleanIdea) idea, then open the generated IDEA project.
Currently in IntelliJ IDEA 2019.2 you can add the gradle subprojects like so
Open Gradle Tool Window via View > Tool Windows > Gradle menu
Click on "Link Gradle Project" button (the plus sign)
Select the build.gradle file corresponding to the subproject
Go to File > Project Structure > Modules > NameOfSubproject
Navigate to main/java and click on Mark as: Sources
Mark the main/resources as Resources
Restart IntelliJ IDEA
The sources of the subproject will be recognized by IntelliJ and you can use Navigate Class action for the classes in the subproject
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.