How can I get the version of the application (defined by tag version im pom) in quarkus specially?

前端 未结 2 1152
夕颜
夕颜 2021-01-28 02:48

I moved from a plain Java EE application to quarkus.io. In Java EE I had the a properties file with version=${project.version} and reeading this file in an JAX RS

2条回答
  •  温柔的废话
    2021-01-28 03:28

    I'm not sure if my approach is the best case scenario but you can try this:

    pom.xml :

    
            
                src/main/resources
                true
                
                    **/application.properties
                
            
       
    

    In application.properties use version property:

    quarkus.version=${quarkus.platform.version}
    

    Then use it as a config property:

    @ConfigProperty(name = "quarkus.version")
    String version;
    

提交回复
热议问题