Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Unable to resolve freemarker dependency in AEM cloud as a service

pharidoss
Level 2
Level 2

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

1 Accepted Solution
Amit-Tiwari
Correct answer by
Level 4
Level 4

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>

View solution in original post

4 Replies
Amit-Tiwari
Correct answer by
Level 4
Level 4

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>

View solution in original post

pharidoss
Level 2
Level 2

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.

 

pharidoss_0-1635950221308.png

 

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.

pharidoss_1-1635950359584.png

 

Not sure what else i am missing

Amit-Tiwari
Level 4
Level 4

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 .

AmitTiwari_0-1635956056681.png

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.

pharidoss
Level 2
Level 2

I think I got it working. Here is what i did

 

1. Added embed into all module pom.xml

<embedded>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<target>/apps/<project>-packages/content/install</target>
</embedded>

2. Added the dependency in core pom.xml

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>

 

3. Added the dependency in parent pom.xml

 

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>

 

I may have added some redundancy here, but after the above steps it imported the dependency and resolved it