intellij idea 添加maven project:

intellij idea 添加maven project:

1.File new Project 选择Maven 勾选Create from archetype 选择列表中的maven-archetype-webapp
2.next 填写GroupId ArtifactId next
3.在Maven home directory这个页面中最下面有个Properties中添加 archetypeCatalog=internal

4.配置tomcat 如图:



如上图选择Deployment,这个时候你会发现无法添加test项目,这是为什么呢?
这是maven和tomcat之间的关系,maven加载web项目,maven项目中的artifactId生成,
所以我们使用以下步骤解决:

打开intellij idea 右侧的Maven Projects 如下图:


点击clean后,



然后这样就可以构建一个简单的maven项目了。

猜你喜欢

转载自xiaoyao8903.iteye.com/blog/2335979