【发布时间】:2019-11-06 05:05:34
【问题描述】:
我想在 RESTful 服务中阅读我的 maven 项目的当前工件版本。我的代码是用 JAX-RS (Quarkus) 编写的。
我正在使用以下pom.xmlsn-p:
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.version}</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
我用下面的 java sn-p 阅读了这个版本:
String vendor = getClass().getPackage().getImplementationVendor();
在我看来,quarkus-maven-plugin 忽略了该行,因为maven-jar-plugin 工作得非常好(我在另一个项目中使用了它):
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
我还没有真正深入了解 maven 和 quarkus。
我在设置quarkus-maven-plugin 时犯了错误吗?
是否有不包括直接从pom.xml 读取的解决方法?
谢谢你帮助我。
编辑: 我将在以下问题后尽快将此主题标记为“已回答” 已解决(由@Guillaume Smet 打开): https://github.com/quarkusio/quarkus/issues/5023
编辑: 问题从今天开始解决。 https://github.com/quarkusio/quarkus/issues/5100
【问题讨论】: