Add a non Gradle Project to a Gradle Multiproject as Module in Intellij

已回答

Project A is a Gradle multi project with the sub projects b and c.
Project X is a non Gradle project. The sub projects depend on (compiled) project X.
The Project X jar is included as file tree dependency in the build.gradle of the sub projects:
    implementation fileTree(dir: project.projectDir.path + '/lib/', include: ['X.jar])
As IDE we are using Intellij. We want to have project A and X in the same workspace and we want to have changes made in project X to be reflected on the classpath of Project A.

We tried to add project X to A,b,c in the Module Settings in Intellij as dependency without success.

Is there a way to achive the described scenario in Intellij without migrating project X to gradle?

 

 

MyGiftCardSite.com

评论操作 固定链接

>Is there a way to achive the described scenario in Intellij without migrating project X to gradle?

It is not possible. This project must be added to a common Gradle multi-module project as a Gradle project. This is the recommended approach, since this way you will get the identical behavior when building the project by Gradle or by IntelliJ IDEA. With such an approach you will also will not need to do an additional configuration in the IDE, since after importing such a Gradle project, IDE will automatically set up the project structure and dependencies.
0

请先登录再写评论。