Unable to resolve freemarker dependency in AEM cloud as a service | Community
Skip to main content
Level 2
November 2, 2021
Solved

Unable to resolve freemarker dependency in AEM cloud as a service

  • November 2, 2021
  • 1 reply
  • 2589 views

Hi,

I am getting the following error when trying to render the freemarker template in AEMaaCS.

I am in step 4 of this documentation http://www.6dglobal.com/blog/aem-with-freemarker-templating-language-2016-02-13 and i see the following error

 

[freemarker.template] in start level 20 but no bundle is exporting these for that start level

 

In the bundles console (system/console/bundles) i see

freemarker.cache,version=[2.3,3) -- Cannot be resolved
freemarker.core,version=[2.3,3) -- Cannot be resolved
freemarker.template,version=[2.3,3) -- Cannot be resolved

 

1. Is the freemarker template supported in AEMaaCS at all anymore?

2. Any pointers to resolve this error would be helpful

 

Thanks,

Prabu

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Amit-Tiwari

Hi,

As per the info you provided, dependency are not getting resolved at runtime.

try embedding the jar in your apps pom and check if that solve the issue.

something like this: "the embeded part "

<plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <embeddeds>
                       ---------
                        <embedded>
                            <groupId>org.freemarker</groupId>
                            <artifactId>freemarker</artifactId>
                            <target>/apps/{yourproject}/install</target>
                        </embedded>
                    </embeddeds>
                </configuration>
            </plugin>

1 reply

Amit-Tiwari
Amit-TiwariAccepted solution
Level 4
November 2, 2021

Hi,

As per the info you provided, dependency are not getting resolved at runtime.

try embedding the jar in your apps pom and check if that solve the issue.

something like this: "the embeded part "

<plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <embeddeds>
                       ---------
                        <embedded>
                            <groupId>org.freemarker</groupId>
                            <artifactId>freemarker</artifactId>
                            <target>/apps/{yourproject}/install</target>
                        </embedded>
                    </embeddeds>
                </configuration>
            </plugin>
pharidossAuthor
Level 2
November 3, 2021

Hi Amit,

 

Thanks for your response. When i add the above in ui.apps pom.xml it gives the error "Cannot resolve symbol" even though the project is compiling but the freemarker dependency is not resolved.

 

 

I dont know for the cloud, they follow a different approach, i see lot of embeds in all pom.xml so i added it there and added the freemarker dependency in core pom.xml and the parent pom.xml file but still not resolving.

 

Not sure what else i am missing

Amit-Tiwari
Level 4
November 3, 2021

It means bundle is not getting packaged with your final build.
just checked the maven repository and find out that there is no bundle for freemarker there.
In order to resolve your issue you need to download the jar for maven repository and convert it into an osgi bundle .

Download the jar for your version and convert it into an osgi bundle that you can install on AEM.
To build the osgi bundle from jar you can follow below links :
1.https://helpx.adobe.com/experience-manager/kb/ConvertAJarIntoOsgiBundle.html 
2. https://wiki.eclipse.org/Creating_OSGi_Bundles_from_Third-Party_JARs (Easy way)
or you can google other ways as well.