IntelliJ does not recognize workspace maven modules

已回答

When using maven, first everything worked fine, but during the last weeks I found that IntelliJ seems to have forgotten how to resolve my workspace artifacts and instead tries to rely on the artifacts in the maven repository.

I've got a huge multi-module maven project (so rebuilding it all the time is not really an option). When I CTRL+Click on the class name in another module (same workspace), it does not lead me to that class in that module, but instead only to a decompiled version of the maven artifact in the repository, which is hugely annoying. Also, it prevents IntelliJ from finding references to something in other modules, making the search for usage function basically useless...

Example:

Parent
   - X (containing class CX)
   - Y (contains a class using CX)

When I now CTRL+Click on the reference to CX in Y, it opens the decompiled view of the jar, but of course, it should recognize that this class is IN the workspace already and it should use that version instead.

Unfortunately, while there seems to be something about "Resolve Workspace Artifact", I have not yet found such a setting. I assume that this is only a simple problem where I just haven't found the right setting...

0

I don't use any takari extension

- mvn org.apache.maven.plugins:maven-help-plugin:effective-pom|grep takari

- find . -name pom.xml -exec grep "<groupId>io.takari.builder</groupId>" {} \;

0

Would be very nice if you could file an issue with the project where this is reproduced: https://youtrack.jetbrains.com/issues/IDEA Thank you.

Using different maven version in Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Maven home directory could also help as a workaround.

0

I'm still seeing this problem and I don't not using the `takari` build plugin. The problem happens once I change my git branch from master to a feature branch. All of the modules' iml files suddenly change from <orderEntry type="module" name="subModule"/> to <orderEntry type="library" name="Maven: com.company:subModule:gitBranch-SNAPSHOT" level="project"/>

I only have the bundled maven plugin and the Maven Helper plugin. Please help, and please don't ask for a sample project as our code is proprietary and I cannot share it.

0

Sounds like https://youtrack.jetbrains.com/issue/IDEA-166313 (we have it in our TODO list for next IDE version updates).

When issue happens do you have any files listed and enabled in Settings(Preferences) | Build, Execution, Deployment | Build Tools | Maven | Ignored Files settings?

0

请先登录再写评论。