当前位置: 首页 > 知识库问答 >
问题:

Quarkus/microprofile读取pom.xml属性

程阳平
2023-03-14
@ConfigProperty(name = "version")
public String version;
version=${quarkus.platform.version}

共有1个答案

冯玮
2023-03-14

试试我在上面发布的内容:quarkus read pom.xml properties

pom.xml:

<resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <includes>
                <include>**/application.properties</include>
            </includes>
        </resource>
   </resources>

在Application.Properties中使用version属性:

quarkus.version=${quarkus.platform.version}
@ConfigProperty(name = "quarkus.version")
String version;
 类似资料: