共享库/ jar的spring自动配置

时间:2019-07-03 11:07:38

标签: java spring maven spring-boot

我在spring上有一个共享库,我想在其中自动配置此依赖关系,为此,我在META-INF下的资源project structure下创建了spring.factories文件

但是当我执行mvn软件包或安装时,我在jar中看不到spring.factories文件,因此无法加载bean。

我的pom.xml文件

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
     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.***</groupId>
<artifactId>spring-audit</artifactId>
<version>2.1.0</version>
<name>spring-audit</name>
<description>An annotation based auditing framework</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <flyway.version>4.0.3</flyway.version>
</properties>
<dependencies>

  *
  *


</dependencies>

0 个答案:

没有答案