[英]Include plain java projects as dependency at gradle project
I have two projects one plain java project and one gradle spring project created from jhipster 我有两个项目,一个是纯Java项目,另一个是从jhipster创建的gradle spring项目。
I would like to use the java project alongside with the gradle one. 我想将Java项目与gradle一起使用。 After search on the net i have found how to do it link1 but this works only if all my projects are gradles.
在网上搜索后,我发现了如何做link1,但这仅在我所有的项目都是毕业时才有效。 Also when i try to add module dependency from Project Structure does not work.
另外,当我尝试从项目结构中添加模块依赖项时不起作用。
Project tree 项目树
workspace
-project1
--build.gradle
-project2
What is the right way of doin this? 正确的做法是什么?
Also why i cannot make changes from IDE's project structure and automatically update build.gradle and settings.gradle with the new dependencies? 另外,为什么我不能从IDE的项目结构中进行更改,并不能使用新的依赖项自动更新build.gradle和settings.gradle?
Change the plain java project into a gradle project, change the two projects into a gradle multi-project. 将普通的java项目更改为gradle项目,将两个项目更改为gradle多项目。
It's not hard to do, the plain java project probably just needs an almost empty build.gradle file and the settings.gradle file just needs to include it. 这并不难,普通的Java项目可能只需要一个几乎空的build.gradle文件,而settings.gradle文件只需要包含它即可。
An IDE cannot help you much in these tasks, you will have to do most of it manually. IDE在这些任务上无法提供很多帮助,您将不得不手动完成大部分任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.