Reputation: 364
I have multiple projects, some are single module, and others are multi-module. Some of these modules are libraries intended to be used in multiple projects.
How do I share these modules between projects, and what would I store in version control?
If I store each module in it's own repository, then the .idea folders will not be available, and as such information about the module such as its dependencies, copyright notices, artefact config etc will be missing. Therefore, I would like to store each project in a repository, but then how would I reference one module from another project as a dependency?
Note: I am using git for version control.
Upvotes: 3
Views: 4179
Reputation: 533432
How do I share these modules between projects.
I would either have a project for common modules, or add them to each project.
and what would I store in version control?
I wouldn't store IntelliJ specific files if you are working with another developer. If not, you can just store everything. What ever you do, you can swap later.
If I store each module in it's own repository,
Or in its own sub-directory. Git does encourage creating more repositories, either way works.
then the .idea folders will not be available,
I would check them in anyway, but if you check them in, they are as available as any other file.
and as such information about the module such as its dependencies, copyright notices, artefact config etc will be missing.
I would use maven for dependencies and build.
Therefore, I would like to store each project in a repository, but then how would I reference one module from another project as a dependency?
You can import a module from one project to another in IntelliJ, but I would use maven which supports this.
Upvotes: 4