Spring Boot Maven插件中的SystemPropertyVariables未设置

时间:2018-08-29 03:21:24

标签: java maven-plugin spring-boot-maven-plugin

这是我在其中设置systemPropertyVariables的插件

<build>
    <plugins>
       <plugin>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-maven-plugin</artifactId>
               <configuration>
                  <systemPropertyVariables>
                      <propertyFilePath>e2e_postgres.properties</propertyFilePath>
                  </systemPropertyVariables>
               </configuration>
        </plugin>
    </plugins>
</build>

这是我访问属性的Java代码

String propertyFilePath = System.getProperty("propertyFilePath");
            if(StringUtils.isEmpty(propertyFilePath)) {
                throw new TestingToolsRuntimeException("Could not find property for 'propertyFilePath'");
            }

由于未设置该属性,因此出现以下异常

com.test.tools.TestingToolsRuntimeException: com.test.tools.TestingToolsRuntimeException: Could not find property for 'propertyFilePath'

我的春季靴子版本是1.5.14.RELEASE。这是财产得不到解决的问题吗?

0 个答案:

没有答案