zoukankan      html  css  js  c++  java
  • 【原】maven web项目eclipse搭建

    1、new->other->Maven Project,点击next

    2、继续next

    3、选择maven-archetype-webapp,如果找不到可以再Filter里面搜索web,就可以找到了。继续next

    4、输入自己定义的名称,如下:

    5、之后再项目名称上面右击->Build Path->add Library->选择Server Runtime,next

     6、选中Apach Tomcat v7.0(你的版本可能是6或者8),Finish

    7、要建立maven结构,需要修改在项目里手动添加文件夹:

    srcmainjava

    srcmain esources

    src estjava

    src est esources

    8、修改项目下面的classpath,类似下面配置:

    <classpathentry kind="src" path="src/main/java"/>
    <classpathentry kind="src" path="src/main/resources"/>
    <classpathentry kind="src" path="src/test/java"/>
    <classpathentry kind="src" path="src/test/resources"/>

    eclipse生成的classpath中:

    <classpathentry kind="src" output="target/classes" path="src/main/java">
    <attributes>
    <attribute name="optional" value="true"/>
    <attribute name="maven.pomderived" value="true"/>
    </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
    <attributes>
    <attribute name="maven.pomderived" value="true"/>
    </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/test-classes" path="src/test/java">
    <attributes>
    <attribute name="optional" value="true"/>
    <attribute name="maven.pomderived" value="true"/>
    </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
    <attributes>
    <attribute name="maven.pomderived" value="true"/>
    </attributes>
    </classpathentry>

    9、在项目名称上右击->reFresh,就可以了

    10、将tomcat端口改为80。

    11、将项目部署到tomcat上,运行tomcat,浏览器输入“localhost/项目名”,就可以访问了

  • 相关阅读:
    C#中Invoke的用法(转)
    C#中Thread.IsBackground 属性
    127.0.0.1是什么地址?
    C# Socket服务器端如何判断客户端断开求解
    C#中线程间操作无效: 从不是创建控件 txtBOX 的线程访问它。
    C#多线程学习之如何操纵一个线程
    利用TCP协议,实现基于Socket的小聊天程序(初级版)
    进程与线程的一个简单解释
    javascript修改css样式表
    html根据下拉框选中的值修改背景颜色
  • 原文地址:https://www.cnblogs.com/seven7seven/p/3981932.html
Copyright © 2011-2022 走看看