zoukankan      html  css  js  c++  java
  • Intellij IDEA14 + Maven + Tomcat 建立工程

    1.New Project ——>选中左侧的Maven ——>点击next

    2.输入GroupId和ArtifactId,点击next

    3.输入Project name,选择Project location,输入Module name,选择Content Root、Module file location,点击finish

    4.选中刚才建的Module右键选择“Add Framwork Support...”,在弹出的对话框中选择Struts 2,点击OK

    5.创建完成后在pom.xml文件中加入以下配置

        <packaging>war</packaging>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <webappDirectory>web</webappDirectory>
                    </configuration>
                </plugin>
            </plugins>
        </build>
        
        <dependencies>
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-core</artifactId>
                <version>2.3.15.3</version>
            </dependency>
        </dependencies>

    6.把生成的struts.xml文件移到resources文件夹下。

    7.配置Tomcat,如下图,点击Before launch:Make下的+号,弹出对话框配置如图所示,点击OK

    8.Maven打包生成target目录,然后再回到刚才Tomcat配置的Deployment下的Deploy at the server startup下的+,选择“External Source...”,选择刚才生成的target目录下生成的war包,点击OK

    9.到此所有配置完成。

  • 相关阅读:
    求100内的数和
    汉诺塔(印度传说)
    ORA-06502:PL/SQL:数字或值错误:数值精度太高
    触发器的编写
    mysql改密码
    LeetCode-238 Product of Array Except Self
    LeetCode-236 Lowest Common Ancestor of a Binary Tree
    LeetCode-233 Number of Digit One
    LeetCode-230 Kth Smallest Element in a BST
    LeetCode-229 Majority Element II
  • 原文地址:https://www.cnblogs.com/FlySheep/p/4706171.html
Copyright © 2011-2022 走看看