IntelliJ 2022.1.1 New Project Creation is Horrible

Answered

System OS: Windows 10 Enterprise, version 21H2
IntelliJ Version: 2022.1.1 Ultimate, version 11.0.14.1-b2043.45 amd64
Build Tool: Maven

Ever since this latest build of IntelliJ was installed on my machine about  a month ago, creating a new project has been a randomized mess. We work on monthly releases (roughly) and I generally create a new project for each release. We are using Maven to build a handful of JARs and WARs, the WARs are deployed on WebLogic 12.2.1.4 servers. I am using the latest WebLogic plugin for this. Some of the WARs are multimodular, some are just one artifact with a single POM.

When I created a new project in the past, I selected the empty project option. Within the Windows folder for the project, I check out the source code for these JAR/WAR projects via Tortoise SVN. (I've never had good luck with the IntelliJ plugin that does this, so just use the third party tool.) Afterward, back in Intellij, I import the Maven project. For this I select File -> Project Structure, then under the Modules tab I select "Import Module" and then select the POM for the project I'm trying to import (parent POM if it's multi-modular.) This always worked fine and imported my projects with all the source folders, test sources, resource folders etc correctly configured.

Now, when I try the steps above each time I create a new project a completely random set of problems arises. Yesterday, the IDE wouldn't even import from a POM until I turned off the "Download pre-built shared indexes" in Settings -> Tools. Once I switched those back to "Ask..." I had to entirely blow away the project, create a new one and restart the IDE. I created an empty project again and this time it would import from the POM. However, NONE of the folders are sourced as "Sources", "Tests" etc. The only thing the IDE configured correctly was excluding the target folder. Also the output paths under Project Structure -> Modules -> {module} -> Paths are completely screwed up and I have to manually go through and point half of them to the correct location in the target folder instead of somewhere in my local Maven repository. Auto Import is also completely broken and I'm not sure how to get that working again. Previous to this build it just worked and I've never had to mess with that.

Is there a walkthrough that shows how to most effectively create a new Project with multiple modules in it for 2022.1.1 that doesn't require this massive amount of wrestling I'm performing?

0
6 comments

Sorry for such an experience.

>the IDE wouldn't even import from a POM until I turned off the "Download pre-built shared indexes" in Settings -> Tools. Once I switched those back to "Ask..." I had to entirely blow away the project, create a new one and restart the IDE.

Were there any errors? What exactly did you see when you were trying to import?

>I created an empty project again and this time it would import from the POM. However, NONE of the folders are sourced as "Sources", "Tests" etc. The only thing the IDE configured correctly was excluding the target folder. Also the output paths under Project Structure -> Modules -> {module} -> Paths are completely screwed up and I have to manually go through and point half of them to the correct location in the target folder instead of somewhere in my local Maven repository. 

Is it a multi-module project? Sounds like modules were not imported as Maven modules for this project. Is it reproducible each time you import this project? Is it possible to have a sample project to check this? It can be uploaded at https://uploads.jetbrains.com. All the information is used only by developers for the investigation. Please also include the IDE logs (use Help | Collect Logs and Diagnostic Data action to collect them).

>Auto Import is also completely broken and I'm not sure how to get that working again. 

Please check the options under Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Reload project after changes in the build scripts settings.

 

The difference between old way of creating a new empty project and a new one is that with the new way - IDE now automatically creates a module for the  empty project.

0

Andrey,

Thanks for getting back with me.

>Were there any errors? What exactly did you see when you were trying to import?
None. I couldn't see any in any popup growls or in any of the consoles. I do have the collected logs to send you and perhaps that will show more.

>Is it a multi-module project? Sounds like modules were not imported as Maven modules for this project. Is it reproducible each time you import this project?
Yes it is multi-module and yes it behaves the same way I try to import.

>Is it possible to have a sample project to check this?
I'm going to have to remove a lot of the source before I can provide it. I do have the logs collected and will provide those at the upload link you supplied.

>Please check the options under Settings...
Those settings show the following:
 - Reload project after changes in the build scripts is checked
 - External changes radio button is also checked.

0

Andrey,

I discovered the cause of the source and auto-import problems. I took another look at everything in the Project explorer and discovered that, for some random reason, every POM except the parent in my multi-module were crossed out. I opened Settings -> Build,Excecution,Deploment -> Build Tools -> Maven -> Ignored Files and they were all checked as ignored. I unchecked them, hit apply, and now all sources are marked correctly. Auto import and similar features are also restored.

I have no idea why the IDE just started ignoring the POMs. Do you still want me to upload the logs I collected?

0

Thank you for the information. Do you switch between branches in this project? Seems to be the https://youtrack.jetbrains.com/issue/IDEA-166313/Maven-projects-is-not-reimported-on-branch-switchproject-update

0

Yes, we do switch branches. However, for my own workflow I've been starting an entirely new project for each set of branches when we move to a new release. I rarely will switch branches within the same project.

0

Interesting. I'm not sure at this moment when the Maven modules could have been added to ignored there.

Please check if the default IDE settings (settings for new projects) do not contain any ignored Maven projects in Settings (Preferences on macOS) |  | Build, Execution, Deployment | Build Tools | Maven | Ignored Files.

Is it always reproducible for you? If so, please try using different state for Toggle Search for Maven Projects Recursively option to find it use Help | Find Action action:

0

Please sign in to leave a comment.