maven web 项目 打入 jar 包 , 和编译入 java 文件到 web-inf 下
<outputDirectory>src\main\webapp\WEB-INF\classes</outputDirectory> 可以把 类文件编译到 web-inf 下 ,用于项目运行 <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<configuration><outputDirectory>src/main/webapp/WEB-INF/lib</outputDirectory></configuration>
<executions>
<execution>
<phase>compile</phase>
<goals><goal>copy-dependencies</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
使用maven 命令 dependency:copy-dependencies -DoutputDirectory=src/main/webapp/WEB-INF/lib 也可以把jar 打到lib下
有时候直接复制这段代码到项目中, executions 可能会报错。 但是自己手动去写的话就不报错(不知道原因)
如果pom.xml还是出一些莫名的错误,可以尝试 剪切全部,然后粘贴
<outputDirectory>src\main\webapp\WEB-INF\lib 可以把项目需要的架包 编译到 web-inf 下的lib ,项目才能启动
所以 如果你搭建的不是一个web 项目,但是你需要 建设一个web项目时 ,你必须 配置 outputDirectory 和 maven-dependency-plugin ,
另外 可能要配置 maven-compiler-plugin 和maven-clean-plugin 插件 ,在clean 的时候 可以 把 maven架包 复制到web-inf 的lib 目录下
maven web 项目 打入 jar 包 , 和编译入 java 文件到 web-inf 下的更多相关文章
- maven 如何给web项目添加jar包依赖
maven 如何给web项目添加jar包依赖 CreateTime--2018年4月19日19:06:21 Author:Marydon 开发工具:eclipse 1.打开pom.xml文件--& ...
- 利用Maven把项目生成jar包供其他项目使用
每当搭建框架时,第一步就是为系统整理一个接一个的jar包.用多了就开始深思,如何把自己的项目也整成jar包,供他人使用呢? 近期一直在看徐晓斌所著:<Maven实战>.因自己学识不够,只是 ...
- Maven下载项目依赖jar包和使用方法
一.Maven3.5.0安装与配置+Eclipse应用 参考:Maven3.5.0安装与配置+Eclipse应用 二.http://mvnrepository.com/ 此处以http://mvnre ...
- maven将依赖打入jar包
将 依赖打入jar包,由于maven管理了所有的依赖,所以将项目的代码和依赖打成一个包对它来说是顺理成章的功能.maven的这个功能之前就用过,但这 次使用时忘了细节,只记得用maven的assemb ...
- Web项目替换jar包中的文件的方法
经常遇到这样的问题,需要修改jar包中的方法.应该如何做? 1.有些很人性化的框架jar包,比如SpringSecurity,可以修改配置文件指定一个新建的类,让类实现Jar包中的对应的接口就好了. ...
- maven中项目发布jar包不同步
昨天的项目今天运行的时候突然发现今天就不能运行了 严重: Error configuring application listener of class org.springframework.web ...
- 使用maven将项目打成jar包
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...
- maven 将项目打成jar包
添加此plugin到项目的pom.xml <project xmlns=</modelVersion> <groupId>fuck</groupId> ...
- maven将依赖打入jar包中
1.在pom.xml中加入maven-assembly-plugin插件: <build> <plugins> <plugin> <artifactId> ...
随机推荐
- 关于BeautifulSoup类中的tag对象的string和text属性
<dl> <dt> 今开 </dt><dd class="s-down">3.87</dd> </dl> & ...
- delphi android路径 TPath 文件路径,文件管理
获取Android相关文档路径 delphi 新路径.文件功能 IOUtils单元,文件路径,文件管理 http://docwiki.embarcadero.com/RADStudio/Berlin/ ...
- as3 文档类引用
/**文档类引用**/ public static var main:CoverMain; public function CoverMain() { main=this; }
- python, Django csrf token的问题
环境 Window 7 Python2.7 Django1.4.1 sqlite3 问题 在使用Django搭建好测试环境后,写了一个提交POST表单提交留言的测试页面. 如图: 填写表单,点击“提交 ...
- No matter how hard it is or no matter how bad it gets, I am going to make it!
No matter how hard it is or no matter how bad it gets, I am going to make it! He always had a yearni ...
- Spring 集成Hibernate的三种方式
首先把hibernate的配置文件hibernate.cfg.xml放入spring的src目录下,并且为了便于测试导入了一个实体类Student.java以及它的Student.hbm.xml文件 ...
- Openning SharePoint - 80 website gives HTTP 404 Error, The webpage cannot be found ! on SharePoint 2013
ask: I tried to open the SharePoint - 80 throw Browse in IIS, but I get HTTP 404 Error (The webpage ...
- 吴裕雄 实战python编程(2)
from urllib.parse import urlparse url = 'http://www.pm25x.com/city/beijing.htm'o = urlparse(url)prin ...
- Containerpilot 配置文件示例
{ consul: "localhost:8500", logging: { level: "INFO", format: "default" ...
- global statement
[global statement] 在线程里,默认所有变量都是本线程局部变量,要想访问全局变量,则要先用global声明. 如全局有变量totalCount,线程中有语句 totalCount += ...