创建maven web项目pom.xml参考代码--mvn命令打war包
来源:互联网 发布:男朋友体力好体验知乎 编辑:程序博客网 时间:2024/05/22 01:45
<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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.abc.java</groupId> <artifactId>coressm</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <!-- build #s --><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><configuration><!-- 对丢失web.xml检测机制进行忽略, Dynamic Web Module 3.0 工程时代不需要web.xml文件注册相关内容的,所以工程默认不生成web.xml。--><failOnMissingWebXml>false</failOnMissingWebXml></configuration></plugin><plugin> <groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.2</version><executions> <execution> <id>default-compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> </executions><configuration><!-- 使用jdk1.7时使用该配置,如果要使用jdk1.8,则下面2行要修改为1.8 --><source>1.7</source><target>1.7</target><encoding>UTF-8</encoding></configuration></plugin></plugins></build> <!-- build #e --></project>
mvn命令打war包(包括源码jar包)
pom.xml中如果没有指定打包类型,默认打包类型为jar
1、确保pom.xml里面引入了:
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-war-plugin --><dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version></dependency>
2、确保项目引入的是jdk,而不是jre;
3、确保项目不报错的情况下,依次执行mvn clean--> mvn package;
或者项目右击run -->mvn clean-->mvn build...-->Goals文本框处输入"package";
4、如果项目出现感叹号,很可能是build path里面的Maven Dependencies里面有出现missing的jar,可以找到jar对应的本地仓库的路径,将对应的版本号里面的.lastUpdated文件删除,都删除后,再项目右击-->maven -->Update Project.
参考:
http://www.blogjava.net/qileilove/articles/410887.html
http://blog.csdn.net/kaku21/article/details/50060637
0 0
- 创建maven web项目pom.xml参考代码--mvn命令打war包
- web项目中代码引用了本地包,又需要使用maven打war包时,pom的配置方法
- maven eclipse web项目 && 打war包
- java web项目命令打war包
- maven 打war包报异常(web.xml 以及jsp js css不在war包中),以及pom.xml 文件配置
- maven工程pom.xml配置引用的jar包和最终打出war包中的jar包版本号不一致——mvn命令的应用
- eclipse web项目用maven打war包丢失.xml文件,丢失.properties文件
- maven项目打War包
- 创建maven项目pom.xml代码
- java项目中利用maven打war包,其pom配置
- Eclipse中的maven项目打war包
- maven项目打jar,war包方法
- Maven项目如何打war包?
- Maven 项目如何打 war 包
- 创建maven web项目 pom报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
- Maven创建web项目pom.xml最基础的配置
- MyEclipse web项目重复打war包
- 【Eclipse】给web项目打war包
- MyBatis Mapper.xml文件中 $和#的区别
- angularjs input type=radio isChecked
- Serializable Externalizable transient singleton readRsolve()
- 点划线的两种实现方法
- java单例模式的5种写法-饿汉、懒汉、静态内部类、双重校验锁、枚举
- 创建maven web项目pom.xml参考代码--mvn命令打war包
- 导入moudle作为自己工程的依赖库进行使用
- spring mvc导入excel
- python opencv 图像尺寸变换
- selenium简介
- linux常用命令
- sqlserver存储过程demo
- Hive建Hdfs外部分区表
- html5移动端触摸事件touch