由于IDEA社区版(Community)无法直接New一个Web Appplication 所以要使用maven来创建
1.创建一个Project
2.
3.
4.这里在Properties中添加一个参数archetypeCatalog=internal
,不加这个参数,在maven生成骨架的时候将会非常慢,有时候会直接卡住。
来自网上的解释:
archetypeCatalog表示插件使用的archetype元数据,不加这个参数时默认为remote,local,即中央仓库archetype元数据,由于中央仓库的archetype太多了,所以导致很慢,指定internal来表示仅使用内部元数据。
5.
6.配置Tomcat
7.点击左上角的加号,选择Maven
8.
9.先在pom.xml中加入tomcat7的插件(注意我在其中的port标签里设置了端口号是9090)
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16<build> <finalName>TestArtif</finalName> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <port>9090</port> <path>/</path> <uriEncoding>UTF-8</uriEncoding> <server>tomcat7</server> </configuration> </plugin> </plugins> </build>
然后点击右上角的绿色三角形箭头,等待tomcat启动,可以在下方看到tomcat的启动信息。(如果是第一次启动,可能要等待从Maven仓库下载插件)
10.tomcat启动成功后,在浏览器输入localhost:9090
最后
以上就是知性小松鼠最近收集整理的关于IDEA Community(社区版) 使用Maven创建Web工程 并部署tomcat的全部内容,更多相关IDEA内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复