MAVEN Archtype 15 Issue with AEM 6.4.3

sathya_prakasha

29-03-2019

Hi Team,

I have created maven project and deployed the same into my local server. I have created a new package under core bundle just say(com.example.myOrg) and created a some couple of java classes . I am getting an error as "com.example.myOrg.*. cannot be resolved to a type" when I am using those java class in my component.

The same java classes are working fine if i moved the classes into other packages which was created by maven intially. The issue is with newly created package alone.

* Bundle is in active status

Do we need to configure something on pom.xml for this?

Accepted Solutions (1)

Accepted Solutions (1)

kiranv40650953

01-04-2019

Hi Sathya,

Update your core pom.xml plugin with <Sling-Model-Packages> tag  like below.

<build>

   <plugins>

   <plugin>

   <groupId>org.apache.sling</groupId>

   <artifactId>maven-sling-plugin</artifactId>

   </plugin>

   <plugin>

   <groupId>org.apache.felix</groupId>

   <artifactId>maven-bundle-plugin</artifactId>

   <extensions>true</extensions>

   <configuration>

   <instructions>


   <Import-Package>

  javax.inject;version=1.0.0,*

   </Import-Package>

   <Sling-Model-Packages>

  com.example.myorg,

    </Sling-Model-Packages>

   </instructions>

   </configuration>

   </plugin>

   </plugins>

</build>

Let me Know if you face any issue.

Thanks,

Kiran

Answers (2)

Answers (2)

sathya_prakasha

01-04-2019

Hi Kiran,

Its not working  ... If I put export package - com.adobe.aem.guides.wknd.core.*  , its working ..any pointers here? i                 

<instructions>

                        <!-- Import any version of javax. , to allow running on multiple versions of AEM -->

                        <Import-Package>javax.inject;version=0.0.0,*</Import-Package>

                        <!--<Export-Package>com.adobe.aem.guides.wknd.core.*</Export-Package> -->

                        <Bundle-SymbolicName>com.adobe.aem.guides.aem-guides-wknd.core</Bundle-SymbolicName>

                          <Sling-Model-Packages>

                            com.adobe.aem.guides.wknd.core

                        </Sling-Model-Packages>

                       

                    </instructions>