zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    一个java的进销存管理系统源码阅读
    嵌入式起步
    java数据库操作有关的杂记
    VS 调试
    软件测试的原则
    黑盒测试与白盒测试
    Xmind快速入门(基本操作够用了)
    opt目录
    日志测试
    bug的前世今生
  • 原文地址:https://www.cnblogs.com/yangml/p/3823464.html
Copyright © 2011-2022 走看看