3 Star 6 Fork 3

孙宇 / nutzdemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pom.xml 6.45 KB
一键复制 编辑 原始数据 按行查看 历史
孙宇 提交于 2014-11-21 11:13 . 添加jetty启动插件
<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>sy.demo</groupId>
<artifactId>nutzdemo</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>sypro Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<!-- 指明使用JDK7 -->
<java-version>1.7</java-version>
<!-- 指明使用utf-8编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<!-- 使用oschina的maven仓库 -->
<!-- <repository> <id>oschinaRepository</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> -->
</repositories>
<pluginRepositories>
<!-- 使用oschina的maven仓库 -->
<!-- <pluginRepository> <id>oschinaPluginRepository</id> <name>local private nexus</name> <url>http://maven.oschina.net/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> -->
</pluginRepositories>
<dependencies>
<!-- dependency标记的scope属性解释: -->
<!-- compile,缺省值,适用于所有阶段,会随着项目一起发布。 -->
<!-- provided,类似compile,期望JDK、容器或使用者会提供这个依赖。如servlet.jar。 -->
<!-- runtime,只在运行时使用,如JDBC驱动,适用运行和测试阶段。 -->
<!-- test,只在测试时使用,用于编译和运行测试代码。不会随项目发布。 -->
<!-- system,类似provided,需要显式提供包含依赖的jar,Maven不会在Repository中查找它。 -->
<!-- 加入junit依赖,用于编写测试类 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12-beta-2</version>
<scope>test</scope>
</dependency>
<!-- 加入nutz依赖,用于MVC/DAO/IOC/AOP和一些工具类的使用 -->
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.b.51</version>
</dependency>
<!-- web环境开发的时候需要用到,不过部署到web容器里是不需要这两个包的 -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2.1-b03</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- jstl依赖包,jsp页面中引入<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>使用 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>
<!-- mysql数据库驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.33</version>
</dependency>
<!-- H2数据库,用他做测试数据库比较方便,使用他的内存数据库模式 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.182</version>
</dependency>
<!-- druid数据源 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.9</version>
</dependency>
<!-- 一些常用工具类 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<!-- apache加密工具类 -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
<!-- javamelody监控工具 -->
<dependency>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.53.0</version>
</dependency>
</dependencies>
<build>
<finalName>nutzdemo</finalName>
<plugins>
<!-- 编译的时候使用JDK7和UTF8编码 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 配置Maven插件(mvn jetty:run可以运行项目) -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.0.M1</version>
<configuration>
<!-- 指定访问端口 -->
<httpConnector>
<port>9999</port>
</httpConnector>
<!-- 间隔x扫描一次,实现热部署 -->
<scanIntervalSeconds>3</scanIntervalSeconds>
<!-- 编写类文件之后,是否自动重启jetty;可选后面两个值[manual|automatic] -->
<reload>manual</reload>
<!-- 指定关闭端口 -->
<stopPort>9998</stopPort>
<stopKey>stop-jetty-for-it</stopKey>
<webApp>
<!-- 指定项目路径(如果不写,则按照pom.xml里面的artifactId属性值配置),访问路径为http://localhost:9999/nutzdemo -->
<!-- 配置<contextPath>/nutzdemo</contextPath>,则访问路径为http://localhost:9999/nutzdemo -->
<!-- 配置<contextPath>/</contextPath>,则访问路径为http://localhost:9999 -->
<contextPath>/nutzdemo</contextPath>
<!-- 更改jetty默认webdefault.xml文件,主要修改了useFileMappedBuffer属性为false,使其不锁定静态文件 -->
<!-- 此文件在C盘\用户目录\.m2\repository\org\eclipse\jetty\jetty-webapp\9.1.0.RC1\找到jar包,打开jar包目录org\eclipse\jetty\webapp\目录中 -->
<!-- <defaultsDescriptor>webdefault.xml</defaultsDescriptor> -->
</webApp>
</configuration>
</plugin>
<!-- 配置mvn install 时跳过单元测试,或者使用mvn package -DskipTests来跳过测试类,或者用mvn test -Dmaven.test.failure.ignore=true命令来忽略测试类的错误 -->
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> -->
</plugins>
</build>
</project>
Java
1
https://gitee.com/sphsyv/nutzdemo.git
git@gitee.com:sphsyv/nutzdemo.git
sphsyv
nutzdemo
nutzdemo
master

搜索帮助