Adding module dependency to Intellij Maven module

I have a maven module, and then I have another maven module called  shared, which has shared classes across all applications. Adding the  shared maven module to the application maven module does not facilitate  Intellij identifying classes in the shared module. What is a way to fix  this?

This isn't for compilation, for compilation I use build-helper-maven-plugin, this is for code interpretation by the IDE.

3 comments
Comment actions Permalink

Sorry, but could you please clarify this sentence: "Adding the  shared maven module to the application maven module does not facilitate  Intellij identifying classes in the shared module":

1) how this shared module is "added"? Do you mean that the dependency to this shared module is added? In this case, IDEA tries to process this dependency as module or library dependency, and this generally works. If the module is present locally, it is converted to IDEA module, if it is only available in repository, then the library is created.

2) if you need the sources of the shared module to be available, then you need either to have this module locally so that it becomes the IDEA module, or deploy your maven module with sources and use 'download sources' option in Maven view of IDEA project.

0
Comment actions Permalink

Both are maven Intellij modules. I am adding one Intellij maven module as a Intellij module dependency to the other in hopes of gaining IDE code interpretation/refactoring between the 2 modules.

Alexander stated in another thread that doing this as I have done in Project Structure should work but I will double check and report back shortly if it does. I dont think it does.

0
Comment actions Permalink

Please note that if this module-module dependency is set up via IDEA ProjectStructure dialog only, not in maven-specific way (as maven dependency in pom.xml), then you may lose it again on the next reimport from maven.

0

Please sign in to leave a comment.