intellij 创建java web项目(maven管理的SSH)

intellij 创建java web项目(maven管理的SSH)

环境intellij IDEA14、MAVEN、Spring、Struts2、Hibernate、Java Web。工程搭建。

1、创建maven项目

1、关闭现有项目,或者new progect
第一步关闭现有项目,或者new progect
2、创建maven的web工程
这里写图片描述
3
这里写图片描述
4
这里写图片描述
5
这里写图片描述

2、添加web工程

6、添加web
这里写图片描述
7这里写图片描述

3、配置tomcat

8这里写图片描述
9这里写图片描述
10这里写图片描述
11这里写图片描述
12这里写图片描述

3、测试

13这里写图片描述

贡献出自己的pom.xml文件,仅供参考

pom.xml


<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>

    <groupId>mavenSSHgroupId>
    <artifactId>mavenSSHartifactId>
    <version>1.0-SNAPSHOTversion>
    <dependencies>
        <dependency>
            <groupId>junitgroupId>
            <artifactId>junitartifactId>
            <version>4.12version>
        dependency>
        <dependency>
            <groupId>commons-dbcpgroupId>
            <artifactId>commons-dbcpartifactId>
            <version>1.2.2version>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-webmvcartifactId>
            <version>3.2.2.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-webartifactId>
            <version>3.2.2.RELEASEversion>
        dependency>
        <dependency>
            <groupId>c3p0groupId>
            <artifactId>c3p0artifactId>
            <version>0.9.1.2version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        
        <dependency>
            <groupId>log4jgroupId>
            <artifactId>log4jartifactId>
            <version>1.2.16version>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>org.slf4jgroupId>
            <artifactId>slf4j-log4j12artifactId>
            <version>1.6.1version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-ormartifactId>
            <version>3.2.2.RELEASEversion>
        dependency>
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-aspectsartifactId>
            <version>3.2.2.RELEASEversion>
        dependency>

        <dependency>
            <groupId>org.apache.strutsgroupId>
            <artifactId>struts2-spring-pluginartifactId>
            <version>2.3.1.2version>
        dependency>


        <dependency>
            <groupId>org.apache.strutsgroupId>
            <artifactId>struts2-json-pluginartifactId>
            <version>2.3.1.2version>
        dependency>

        <dependency>
            <groupId>org.hibernategroupId>
            <artifactId>hibernate-coreartifactId>
            <version>3.6.10.Finalversion>
        dependency>
        <dependency>
            <groupId>javassistgroupId>
            <artifactId>javassistartifactId>
            <version>3.12.1.GAversion>
        dependency>
        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.6version>
        dependency>
        <dependency>
            <groupId>org.apache.tomcatgroupId>
            <artifactId>servlet-apiartifactId>
            <version>6.0.33version>
            <type>jartype>
            <scope>providedscope>
        dependency>
        <dependency>
            <groupId>org.codehaus.jacksongroupId>
            <artifactId>jackson-mapper-aslartifactId>
            <version>1.9.3version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>org.codehaus.jacksongroupId>
            <artifactId>jackson-core-aslartifactId>
            <version>1.9.3version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>commons-langgroupId>
            <artifactId>commons-langartifactId>
            <version>2.6version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>org.apache.velocitygroupId>
            <artifactId>velocityartifactId>
            <version>1.7version>
        dependency>
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>jstlartifactId>
            <version>1.2version>
            <type>jartype>
            <scope>compilescope>
        dependency>
        <dependency>
            <groupId>commons-beanutilsgroupId>
            <artifactId>commons-beanutilsartifactId>
            <version>1.8.3version>
        dependency>
    dependencies>

project>

你可能感兴趣的:(Java,Web,Framework)