Submodule project dependency cannot be found

Answered

I asked question on stack overflow.This is the link https://stackoverflow.com/questions/49903255/maven-child-module-external-dependency-package-does-not-exist-in-intellij-ide

If I open one project which does not have module I can build my project. If I open sub module and add my external jar file as library, even though I can reference my code, when I try to build my project, Intellij says package does not exist. 

I provided sampe code  on github. This is the link https://github.com/ftylmz1/nestedmoduletest Can someone help me? 

0
3 comments

The problem has nothing to do with IntelliJ IDEA. It's the issue with your pom.xml configuration.

You need to add a dependency to the jar as described here: https://stackoverflow.com/a/22300875/104891.

0
Avatar
Permanently deleted user

Thank you for your response. It helped. I appreciate it. By the way, dont you think it is misleading that my project can be built, if I open plain maven project which does have submodule. I followed your IDE adding library conventions then I was able to build my project even though I did not add the jar file to my dependency in pom.xml

0

In a Maven project all the dependencies should be added in pom.xml since the synchronization is one way only.

0

Please sign in to leave a comment.