• 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

  • 相关阅读:
    sharepoint ECMA 添加指定的人员和指定的角色到某个list里
    sharepoint ECMA 添加User到Site组
    sharepoint ECMA PeopleEditor 清除选中的中的人员
    sharepoinT Modal Dialog
    sharepoint ECMA
    sharepoint 列表查询范围
    sharepoint 2013 添加Quickpart
    背包、队列和栈
    Java 同步块
    Andriod性能优化笔记
  • 原文地址:https://www.cnblogs.com/yangml/p/3823464.html
Copyright © 2020-2023  润新知