Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.inject,version=[0.0,1) -- Cannot be resolved

Is there any other work around to fix the javax.inject,version=[0.0,1) -- Cannot be resolved issue in OSGI bundle

I have tried all the approaches provided in the below forum. but still my bundle doesn't resolve.

I am using AEM 6.2 + Java version: 1.8.0_121 + Apache Maven 3.3.9 and archetypeVersion=10

And my code can be found at my GDrive

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

Javax inject

like image 219
VAr Avatar asked Jun 01 '26 12:06

VAr


1 Answers

In core pom.xml file add Import-Package tag for "javax.inject" with "version=0.0.0,*" inside "org.apache.felix" plugin tag like below [Tested on AEM 6.2 working perfect]

<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>
like image 168
ArpitBora Avatar answered Jun 03 '26 04:06

ArpitBora