javax.inject,version = [0.0,1) - 无法解析

VAr*_*VAr 2 osgi-bundle aem aem-6 javax

是否有任何其他工作来解决javax.inject,version=[0.0,1) -- Cannot be resolvedOSGI包中的问题

我已经尝试了下面论坛中提供的所有方法.但我的捆绑仍未解决.

我使用的是AEM 6.2 + Java版本:1.8.0_121 + Apache Maven 3.3.9和archetypeVersion = 10

我的代码可以在我的GDrive中找到

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__fikl-ive_just_updatedfro.html

Javax注入

小智 6

在核心pom.xml文件中添加" javax.inject "的Import-Package标签,其中" version = 0.0.0,* "在" org.apache.felix "插件标签内,如下所示[在AEM 6.2上测试完美工作]

<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <extensions>true</extensions>
  <configuration>
    <instructions>
      <!--
       <Embed-Dependency>
          artifactId1,artifactId2;inline=true
       </Embed-Dependency>
      -->
      <!-- Import any version of javax.inject, to allow running on multiple versions of AEM -->
      <Import-Package>javax.inject;version=0.0.0,*</Import-Package>

      <Sling-Model-Packages>
        com.next.sample_test_impl.core
      </Sling-Model-Packages>
    </instructions>
  </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)