What should I do if the corresponding module cannot be found in the new Maven project?

Solve the problem of missing Maven project templates

question

The software was reinstalled, but I found that the Maven template only had the content of the two kotlin modules. Well, I panicked, but there is a solution.
insert image description here

exploration process

According to the solution found on the Internet, install Maven Archetype Catalogsthe plug-in.
insert image description here
insert image description here
However, it didn't work, or not.
So I created an empty Maven project without using a template, created a new Maven project under this project, and then had many templates to choose from. How strange!
insert image description here
Then I wondered if the plugin I just installed was useless, so I uninstalled it.
insert image description here
Sure enough, it has nothing to do with this plugin.
Looking at the screenshot below, in order to verify my idea, I opened an empty folder as the project space, and created a new Maven project under this project. Only the templates in the two kotlin modules shown below can be selected.
insert image description here
And when I use idea to directly create a project, this problem will not occur.

solution

Create new engineering projects directly in idea.
insert image description here
insert image description here
However, my habit is to create a new empty project first.
insert image description here
insert image description here
insert image description here
insert image description here

insert image description here
insert image description here

Summarize

Do not select an empty folder from the hard disk as the startup of the empty project, because the empty project created in the idea does not really generate an empty folder on the hard disk, but generates other configuration files such as other files by the way, which is .ideaalso That's why you can't create Maven projects for other templates directly from an empty folder. If you want an empty project, please create it in the idea tool.
Hahaha now that I know the reason, I won’t encounter such a problem next time! Got a little more today! awesome!

Guess you like

Origin blog.csdn.net/weixin_51229662/article/details/124847276