简体   繁体   中英

Java/Gradle - Circular project dependencies

So I am writing a program that the users create plugins for. So far I have 3 Gradle projects, the main engine, a plugin template application and a plugin interface library (all the interfaces the user's plugin implements). The user implements their own plugin and compiles it to a jar (currently this jar also includes all the plugin interfaces), and then they place the plugin in the resources folder of the main engine application (So the main engine application will end up having a folder of plugin jars). Currently, the problem with this is that every jar in this folder has a copy of the interfaces (which is wasted space), and I want the user's plugin code to be able to access the engine as well (Like how Minecraft forge does), almost as if they are in the same project which with my setup isn't possible. What is the best structure for this?

将接口库shade到引擎中,然后用compileOnly获取用户的添加接口依赖

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM