Expand my Community achievements bar.

SOLVED

MAVEN Archtype 15 Issue with AEM 6.4.3

Avatar

Level 5

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?

1 Accepted Solution

Avatar

Correct answer by
Level 3

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

View solution in original post

3 Replies

Avatar

Correct answer by
Level 3

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

Avatar

Community Advisor

Hi,

Please don’t use package name in Capital letter.

Package name should be in small case.



Arun Patidar

Avatar

Level 5

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>