IDEA 社群版搭建一個基於MAVEN的簡單web專案
阿新 • • 發佈:2022-03-08
IDEA 專業版整合的有Tomcat Server,搭建過程:
https://blog.csdn.net/weixin_39971186/article/details/88904083
但是發現IDEA 社群版不能配置Tomcat Server,如圖:
解決:建立MAVEN 專案後,在POM 中引入tomcat外掛
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <!--配置埠號--> <port>81</port> <!--配置專案路徑--> <path>/</path> </configuration> </plugin>
配置執行命令:
在main目錄下建立 java、resources,在src目錄下建立 test/java,開啟 file->project structure,在modules下設定 Sources(java) , Resources(resources) , Tests(test/java)
目錄結構:
也可以用smart tomcat 搭建,參考: