简体   繁体   中英

Use module in multiple projects IntelliJ

我有几个项目需要相同的核心数据库和实用程序类,所以我决定制作一个“核心”模块来放入这些模块。有没有办法在多个项目中使用这个模块,或者我是否使用模块用于错误的目的?

Yeah! While I obviously can't provide a thorough critique of how you're using modules given what you've told us, the fact that you've encapsulated reusable functionality in this one is certainly a good sign!

Given that such is the purpose of modules, surely intelliJ would want to make it easy to share them across projects - and they did: In the File menu, there's an option to "Import Module". Click that and walk through the wizard, selecting the directory where your module is stored, and it'll appear in your Projects menu as normal.

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