8

I have a Java Intellij Idea project that contains multiple modules that I wish to convert to a gradle project. Is there a way to add gradle to an existing project with multiple modules? I want to be able to use gradle to compile and generate JAR files (via artifacts) and generate JavaDocs using gradle.

Intellij Idea version: Intellij Idea CE v2016.3.1
Gradle version: Gradle 3.2.1
Java version: 1.8.0_112
Javac version: 1.8.0_112

Clumsy-Coder
  • 542
  • 1
  • 7
  • 20
  • Please have a look in this post: http://stackoverflow.com/questions/26745541/best-way-to-add-gradle-support-to-intellij-project?rq=1 – Neelmani Ghimire Dec 22 '16 at 18:23
  • It need not be either/or. You can still use IntelliJ with Gradle or Maven. – duffymo Dec 22 '16 at 18:27
  • @NeelmaniGhimire I went to the link you provided. Created a build.gradle file. Added **apply plugin: 'idea'** and **apply plugin: 'java'**. Ran **gradle cleanIdea** and **gradle idea**. The thing I'm looking for is for intellij idea generate the gradle file based on the modules it has. The gradle file be able to compile, run, generate JavaDocs and create JAR files from the artifacts in the project. Is there a way to do that? – Clumsy-Coder Dec 28 '16 at 15:52
  • 1
    @Clumsy-Coder Did you ever solve this? I'm in the same situation, I use the Artifacts to create a WAR, JAR into an EAR. Also, want all the Project Structure | Libraries added as dependencies to the gradle.build too. – NOTiFY Jul 10 '18 at 14:44
  • Does this answer your question? [Convert Java Project to Gradle Project in Intellij](https://stackoverflow.com/questions/44892664/convert-java-project-to-gradle-project-in-intellij) – Nolequen Nov 17 '21 at 09:18

0 Answers0