方案一:

<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多项目资源共享的更多相关文章

  1. idea中的java web项目(添加jar包介绍)和java maven web项目目录结构

    java web项目 web项目下web根目录名称是可以更改的 idea中新建java web项目,默认src为Sources Root,当然也可以手动改,在Sources Root下右键只能新建Pa ...

  2. java:Maven构建项目速度太慢的解决办法,以及报错Retrieving archetypes:' has encountered a problem

    如果报错信息如下: Retrieving archetypes:' has encountered a problemAn internal error occurred during:"R ...

  3. java maven web 项目启动之后,访问所有页面为空白,不是404!!!

    自己解决了大半天,后面通过解决spring单元测试的时候,发现单元测试可以用了,项目启动也可以访问页面了,具体原因不太清楚 可能原因: (1)pom.xml 依赖有重复的地方 (2)不排除与公司内网有 ...

  4. java + maven 实现发送短信验证码功能

    如何使用java + maven的项目环境发送短信验证码,本文使用的是榛子云短信 的接口. 1. 安装sdk 下载地址: http://smsow.zhenzikj.com/doc/sdk.html ...

  5. Maven构建项目后项目报Error错误Java compiler level does not match the version of the installed Java project fac

    项目->右键->Project Facets->修改facets中Java版本(下拉箭头出)为要用的版本 Maven构建项目需注意 1.项目右键->Preferences-&g ...

  6. Java Web学习系列——Maven Web项目中集成使用Spring、MyBatis实现对MySQL的数据访问

    本篇内容还是建立在上一篇Java Web学习系列——Maven Web项目中集成使用Spring基础之上,对之前的Maven Web项目进行升级改造,实现对MySQL的数据访问. 添加依赖Jar包 这 ...

  7. Java Web学习系列——Maven Web项目中集成使用Spring

    参考Java Web学习系列——创建基于Maven的Web项目一文,创建一个名为LockMIS的Maven Web项目. 添加依赖Jar包 推荐在http://mvnrepository.com/.h ...

  8. IntelliJ IDEA 15开发Java Maven项目

    1.安装好之后开始创建项目

  9. 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 ...

随机推荐

  1. 关系网络数据可视化:2. Python数据预处理

    将数据中导演与演员的关系整理出来,得到导演与演员的关系数据,并统计合作次数 import numpy as np import pandas as pd import matplotlib.pyplo ...

  2. Redis数据库 01概述| 五大数据类型

    1.NoSQL数据库简介 解决应用服务器的CPU和内存压力:解决数据库服务的IO压力: ----->>> ① session存在缓存数据库(完全在内存里),速度快且数据结构简单: 打 ...

  3. Trident中的DRPC实现

    一:介绍 1.说明 Storm里面引入DRPC主要是利用storm的实时计算能力来并行化CPU intensive的计算.DRPC的storm topology以函数的参数流作为输入,而把这些函数调用 ...

  4. logging日志文件配置

    Django配置如下 简洁版: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console' ...

  5. spring框架加载完成后执行上下文刷新事件(ContextRefreshedEvent)

    目前spring框架是j2ee比较常用的项目开发技术,只需在web.xml文件中进行少许配置即可,代码如下所示:<!--spring的配置文件--><context-param> ...

  6. Python 面向对象的补充

    isinstance(obj,cls)和issubclass(sub,super) isinstance(obj,cls)检查是否obj是否是类 cls 的对象 1 class Foo(object) ...

  7. SpringBoot整合mongoDB

    MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的. 这一片文章介绍一个springboot整合mongodb,如果你了解整合mysql之类的 ...

  8. JAVA中final修饰符小结

    一.final关键字可以用来修饰类.方法.变量.各有不同. A.修饰类(class).      1.该类不能被继承.      2.类中的方法不会被覆盖,因此默认都是final的.      3.用 ...

  9. RESTful restful api Representational State Transfer

    通俗直白讲:REST是一种编写风格,一种API接口规范.它的风格就是将对象(如学生)的状态(如增删改查,API接口版本号等等)通过其他方式传递,API的接口地址突显出描述的对象. -- == REST ...

  10. 关于git分支管理,推送拉取等等

    git推送本地分支到远程分支 场景 有时候我们开发需要开一个分支,这样可以有效的并行开发. 开分支有两种方式: 一种是在远程开好分支,本地直接拉下来; 一种是本地开好分支,推送到远程. 远程先开好分支 ...