• eclipse中创建MAVEN-web项目


    第一步:
    创建maven web工程

    第二步:
    继承parent
    修改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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>cn.bling.maven</groupId>
    <artifactId>web</artifactId>
    <packaging>war</packaging>
    <name>web Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <parent>
    <groupId>cn.bling.maven</groupId>
    <artifactId>Parent</artifactId>
    <version>0.0.1-RELEASE</version>
    <relativePath>../Parent/pom.xml</relativePath>
    </parent>

    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    </dependency>
    <dependency>
    <groupId>cn.bling.maven</groupId>
    <artifactId>MakeFriends</artifactId>
    </dependency>
    </dependencies>

    </project>

    第三步:
    建立测试jsp
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="cn.bling.maven.MakeFriends.*"%>
    <%
    MakeFriends makeFriends=new MakeFriends();
    out.println(makeFriends.makeFriends("wanglipeng"));
    %>

    第四步:
    自动部署到tomcat下面
    <build>
    <finalName>web</finalName>
    <plugins>
    <plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.2.3</version>
    <configuration>
    <container>
    <containerId>tomcat5x</containerId>
    <home>D:/Program Files/Apache Software Foundation/Tomcat 7.0</home>
    </container>
    <configuration>
    <type>existing</type>
    <home>D:/Program Files/Apache Software Foundation/Tomcat 7.0</home>
    </configuration>
    </configuration>
    <executions>
    <execution>
    <id>cargo-run</id>
    <phase>install</phase>
    <goals>
    <goal>run</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>

    第五步:
    模块聚合
    修改parent.pom

  • 相关阅读:
    内置系统账户:Local system/Network service/Local Service 区别
    python-基于文件导入的特性的单例模式
    php原因 nginx报错[error] 10773#0: *272212065 recv() failed (104: Connection reset by peer) while reading response header from upstream
    实用Django ORM实用操作方法
    session是什么和cookie的区别?
    Python可迭代对象,迭代器,生成器
    浅析python中的GIL锁和协程
    git 常用
    testlink安装
    redmine搭建
  • 原文地址:https://www.cnblogs.com/yangml/p/3823464.html
Copyright © 2020-2023  润新知