IntelliJ IDEA社区版Community创建maven并布置到tomcat

来源:互联网 发布:文件数据库 编辑:程序博客网 时间:2024/05/22 13:06

1.创建一个Project




2.



3.


4.这里在Properties中添加一个参数archetypeCatalog=internal,不加这个参数,在maven生成骨架的时候将会非常慢,有时候会直接卡住。





5.


6.配置Tomcat,点击右上角的 Edit Congihurations


7.点击左上角的加号,选择Maven


8.修改名字和Conmmand line


9.先在pom.xml中加入tomcat7的插件(注意我在其中的port标签里设置了端口号是9090)

[html] view plain copy
  1. <build>  
  2.     <finalName>TestArtif</finalName>  
  3.     <plugins>  
  4.       <plugin>  
  5.         <groupId>org.apache.tomcat.maven</groupId>  
  6.         <artifactId>tomcat7-maven-plugin</artifactId>  
  7.         <version>2.1</version>  
  8.         <configuration>  
  9.           <port>9090</port>  
  10.           <path>/</path>  
  11.           <uriEncoding>UTF-8</uriEncoding>  
  12.           <server>tomcat7</server>  
  13.         </configuration>  
  14.       </plugin>  
  15.     </plugins>  
  16.  </build>  


然后点击右上角的绿色三角形箭头,等待tomcat启动,可以在下方看到tomcat的启动信息。(如果是第一次启动,可能要等待从Maven仓库下载插件)


10.tomcat启动成功后,在浏览器输入localhost:9090




阅读全文
0 0
原创粉丝点击