8

My pom.xml that has been stable for over 24 months is now not working within Intellij - and I can not figure out why it stopped doing so. Here is the modules section:

<modules>
    <module>tcpclient</module>
    <module>tfdma</module>
    <module>tf</module>
    <module>tfspark</module>
    <module>registry</module>
    <module>p2prdd</module>
</modules>

But now the already-existing Run Configurations are no longer working due to not finding classes. I can not even see the modules to try to fix the problem :note that only the Parent module is shown

enter image description here

Note that my next step will be to blow away all the Intellij artifacts such *.iml and .idea/* . But there is a cost to that: e.g. losing my (intricate) run configurations. This is not a preferred solution.

Any ideas why this would have happened?

WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
  • Try reimporting, you can backup and restore your run configurations per https://stackoverflow.com/a/3136255/104891. – CrazyCoder Jul 23 '19 at 18:19
  • @CrazyCoder hey thanks for stopping by - always great to get _the_ IJ guy here!. Thx for the `runConfigurations` tip. See my answer also below: the workaround is pretty light-hearted/relatively painless. I'm just _lost_ without IJ (nothing else comes remotely close to its power) so whatever little kinks come up we just do what we can. – WestCoastProjects Jul 23 '19 at 18:40
  • Give this a try. https://www.youtube.com/watch?v=u6jirc1x25U – Dilip Raj Baral Aug 15 '21 at 13:07

3 Answers3

13

Go to pom.xml of each module, right click -> add as maven project. This should solve the issue.

Version:2020.2.2

selman
  • 1,215
  • 2
  • 15
  • 33
7

Just check if the pom of submodule is not ignored (strike out) Right click on submodule's pom.xml -> maven -> unignore projects

  • 2
    This answer helped me fixing the issue; I had to right-click on the pom and actually ignore each maven submodule first. After doing that, you can unignore the modules again. Only then IntelliJ would recognize it again as a maven module. – RDO Sep 29 '22 at 04:33
  • Thanks for this. I did an ignore then unignore on one submodule and they all got recognised. – Rob Bygrave Dec 11 '22 at 23:00
1

I walked into a workaround: do Import Module from [Maven] Model under Project Structure:

enter image description here

After pointing to one of the half dozen modules and clicking OK then Intellij re-imported all six for me:

enter image description here

So this is bit weird but then not so bad to resolve..

WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
  • 1
    [This bug](https://youtrack.jetbrains.com/issue/IDEA-211346) might be the case. It's fixed in https://www.jetbrains.com/idea/nextversion/. The workaround in the ticket looks similar to what you did. – CrazyCoder Jul 23 '19 at 18:41
  • @CrazyCoder Thx for that info! Always great when you have a chance to stop by. – WestCoastProjects Aug 01 '19 at 11:21