如果我运行我的项目我运行错误,但如果我从终端运行项目一切都没关系

时间:2016-12-29 13:09:17

标签: maven spring-boot spring-tool-suite

如果我从终端运行我的项目一切都没问题,但如果我从Spring Tool Suite运行项目我收到此错误 enter image description here

我用于从终端运行项目的脚本是

./mvnw -P dev,casalibro-dev

在pom文件中我设置了这个配置文件

<profile>
        <id>casalibro-dev</id>
        <properties>
            <datasource.url>jdbc:postgresql://localhost:5432/casalibro</datasource.url>
            <datasource.username>casalibro</datasource.username>
            <datasource.password>xxxxxx</datasource.password>
        </properties>
    </profile>

1 个答案:

答案 0 :(得分:0)

pom.xml文件的主要用途是定义项目的构建。如果要为应用程序本身定义属性,则应将application.properties文件添加到应用程序的资源部分,并在其中定义属性。这些属性将成为您应用的一部分,可以在运行时使用。