【Java】maven多项目资源共享
方案一:
<resources>
<resource>
<!-- <directory>${project.parent.relativePath}/../../config</directory> -->
<directory>${basedir}/../../config</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.txt</include>
<!-- <include>**/*.config</include>
<include>key/*.*</include> -->
</includes>
<!-- <targetPath>resources</targetPath> -->
</resource>
<resource>
<directory>src/main/resources</directory>
<!-- <include>**/*.xml</include>
<filtering>true</filtering> -->
</resource>
</resources>
方案二:
资源端:
<!-- https://stackoverflow.com/questions/2362652/excluding-classes-in-maven-checkstyle-plugin-reports -->
<!-- https://stackoverflow.com/questions/14117709/configuring-maven-to-generate-output-outside-the-project-directory -->
<!-- https://blog.sonatype.com/2008/04/how-to-share-resources-across-projects-in-maven/ -->
<!-- http://maven.apache.org/plugins/maven-remote-resources-plugin/examples/sharing-resources.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${maven-remote-resources-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*</include>
</includes>
</configuration>
</plugin>
引用端:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${maven-remote-resources-plugin.version}</version>
<configuration>
<resourceBundles>
<resourceBundle>com.laplace:laplace:${project.version}</resourceBundle>
</resourceBundles>
</configuration>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
【Java】maven多项目资源共享的更多相关文章
- idea中的java web项目(添加jar包介绍)和java maven web项目目录结构
java web项目 web项目下web根目录名称是可以更改的 idea中新建java web项目,默认src为Sources Root,当然也可以手动改,在Sources Root下右键只能新建Pa ...
- java:Maven构建项目速度太慢的解决办法,以及报错Retrieving archetypes:' has encountered a problem
如果报错信息如下: Retrieving archetypes:' has encountered a problemAn internal error occurred during:"R ...
- java maven web 项目启动之后,访问所有页面为空白,不是404!!!
自己解决了大半天,后面通过解决spring单元测试的时候,发现单元测试可以用了,项目启动也可以访问页面了,具体原因不太清楚 可能原因: (1)pom.xml 依赖有重复的地方 (2)不排除与公司内网有 ...
- java + maven 实现发送短信验证码功能
如何使用java + maven的项目环境发送短信验证码,本文使用的是榛子云短信 的接口. 1. 安装sdk 下载地址: http://smsow.zhenzikj.com/doc/sdk.html ...
- Maven构建项目后项目报Error错误Java compiler level does not match the version of the installed Java project fac
项目->右键->Project Facets->修改facets中Java版本(下拉箭头出)为要用的版本 Maven构建项目需注意 1.项目右键->Preferences-&g ...
- Java Web学习系列——Maven Web项目中集成使用Spring、MyBatis实现对MySQL的数据访问
本篇内容还是建立在上一篇Java Web学习系列——Maven Web项目中集成使用Spring基础之上,对之前的Maven Web项目进行升级改造,实现对MySQL的数据访问. 添加依赖Jar包 这 ...
- Java Web学习系列——Maven Web项目中集成使用Spring
参考Java Web学习系列——创建基于Maven的Web项目一文,创建一个名为LockMIS的Maven Web项目. 添加依赖Jar包 推荐在http://mvnrepository.com/.h ...
- IntelliJ IDEA 15开发Java Maven项目
1.安装好之后开始创建项目
- Java Web 入门(一)使用 Intellij IDEA 14.1.5 创建 Maven Web项目
1.基础配置 1.1 安装 JDK1.7,配置系统变量:JAVA_HOME 和 Path 1.2 安装 Tomcat 7.0 1.3 安装 Intellij IDEA 14.1.5 1.4 Mave ...
随机推荐
- mysql查看变量/配置文件位置
//查看所有变量 show global variables //查看某个变量的值 show global variables where variable_name like '%innodb_fl ...
- TopCoder SRM502 Div1 500 贪心 01背包
原文链接https://www.cnblogs.com/zhouzhendong/p/SRM502-500.html SRM502 Div1 500 好题. 首先,如果已经确定了解决所有问题的优先级, ...
- Codeforces Gym100543B 计算几何 凸包 线段树 二分/三分 卡常
原文链接https://www.cnblogs.com/zhouzhendong/p/CF-Gym100543B.html 题目传送门 - CF-Gym100543B 题意 给定一个折线图,对于每一条 ...
- 基于Docker的服务器搭建
-----------基于Docker的多种服务器搭建----------- 开发环境 本机上的虚拟机 Centos7.4 Docker1.13.1 Openssl1.1.1 1 Nginx 1.1 ...
- 记录Ubuntu & Windows下安装PyV8
https://blog.csdn.net/hanshileiai/article/details/51628173
- linux 学习笔记 cpio命令
1 文件或目录打包 打包有如下多种情况 A>包含子目录打包 find /usr/lib -print /cpio -o >/uo/temp1.cpio 将/usr/lib目录下的文件与子目 ...
- Unity容器在asp.net mvc中的IOC应用及AOP应用
<asp.net-mvc框架揭秘>一书中,有个示例,是使用unity容器来注入自定义的控制器工厂.代码示例可以自己去下载源码,在这里我就不说了.IOC容器的本质是解耦的实例化接口类,而如何 ...
- SQL 分隔字符串
ALTER FUNCTION dbo.fn_Split ( ), ) ) RETURNS @table_Value TABLE ( SortNo ,) NOT NULL, Value ) COLLAT ...
- react-router那些事儿
切换路由时,控制台警告 Can Only update a mounted or mounting component.this usually means you called setState() ...
- angular笔记_4(函数)
angular.isString();是否字符串 angular.isNumber();是否数字 angular.isArray();是否数组 angular.isDate();是否日期/时间 ang ...