How to depend on maven artifact instead of module?
I've found discussions of people having the opposite problem to mine -- that is, they want to depend on the output from a module in the same project instead of the maven artifact -- but I would like to be able to depend on the artifact even when the module is in the same project. The code I'm writing is doing pattern-matching on the classpath, but since maven sees the artifact and intellij sees a target dir, I'm having difficulty getting the same code to work in both contexts.
Is there any way I can tell intellij not to use the module output dir when I've defined a dependency in maven that happens to reside in the same (multi-module) project? I only want that behavior for this specific module -- other modules should still depend on each other via target dirs so that the normal expected behavior is maintained elsewhere in the project.
Thanks!
Please sign in to leave a comment.
Use some specific dependency version that is available in the repository, while your project dependency has a different version (like SNAPSHOT).
Thanks Serge, that's a good suggestion. Unfortunately, these modules have been on the same SNAPSHOT version for years, so there is no other relevant version to depend on. Is there any other way to tell IntelliJ to use the artifact?
I'm afraid, there is no other way.
Ok, thanks! At least now I know I can stop fiddling with project/module settings. :)