Tomee+Microprofile UnsatisfiedResolutionException 异常

Tomee+Microprofile UnsatisfiedResolutionException

各位!
你能给我一些关于这样的问题的建议吗?
我有一个简单的测试项目,以便使用 Microprofile 配置进行测试。
我测试的领域class 我测试:

   @Inject
   @ConfigProperty(name = "injected.value")
   private String injectedValue;

所以这是我的 pom 的依赖项部分:

<dependencies>
        <!-- https://mvnrepository.com/artifact/org.eclipse.microprofile/microprofile -->
        <dependency>
            <groupId>org.eclipse.microprofile</groupId>
            <artifactId>microprofile</artifactId>
            <version>3.3</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
</dependencies>

我构建 war 然后:
1. 当我将 war 部署到 tomee 8.0.1-microprofile(带有 tomeeClassifier 的 tomee-maven-plugin 设置为 microprofile)时 -> 然后一切正常。
2. 但是当我将 war 部署到 tomee 8.0.1-plus(tomee-maven-plugin with tomeeClassifier 设置为 plus)时 -> 然后我得到异常:

org.apache.webbeans.exception.WebBeansDeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.lang.String] is not found with the qualifiers 
Qualifiers: [@org.eclipse.microprofile.config.inject.ConfigProperty(name=injected.value, defaultValue=org.eclipse.microprofile.config.configproperty.unconfigureddvalue)]
for injection into Field Injection Point, field name :  injectedValue, Bean Owner : ...

案例 1(部署到 tomee 8.0.1-microprofile)更多,当我将 pom 依赖项更改为:

<dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>8.0.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>1.4</version>
        </dependency>
</dependencies>

我收到错误:

 org.apache.webbeans.exception.WebBeansDeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.lang.String] is not found with the qualifiers 
Qualifiers: [@org.eclipse.microprofile.config.inject.ConfigProperty(name=injected.value, defaultValue=org.eclipse.microprofile.config.configproperty.unconfigureddvalue)]...

有人可以帮我解决这个问题吗?
我需要在产品中使用 Microptofile,但目前我无法使用。

要使 plus 和 plume 版本正常工作,您必须在 system.properties 中包含以下 属性:

tomee.mp.scan = 全部

参考: http://tomee-openejb.979440.n4.nabble.com/MicroProfile-Integration-in-Plus-and-Plume-td4686818i60.html

另一种方法是使用 tomee 插件并在 pom.xml 中添加此 属性 :

<systemVariables>
       <tomee.mp.scan>all</tomee.mp.scan>
 </systemVariables>