Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Creating a one shot install for a project in AEM 5.6.1

Avatar

Former Community Member

Hi,

I am new to Adobe CQ now AEM, I have been struggling to implement a one shot install for an existing project but so far not been able to succeed.

This is what I have currently

  1. A package which basically has few configs, template and a component(I make changes to CRXDLite and build the package)
  2. 4 bundles which have the OSGi Services.(I make changes to the individual maven projects and upload the jar manually)

 

Now what I expect to do is to cutdown this two step process to one. Can someone explain the steps in an easy to understand way.

Appreciate any replies!!!

 

Regards,

Neha

1 Accepted Solution

Avatar

Correct answer by
Level 10

Make jar part of install (/apps/<projectname>/install) directory in repository.  Then create a package including jar file.

http://www.aemcasts.com/aem/episode-1.html

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Make jar part of install (/apps/<projectname>/install) directory in repository.  Then create a package including jar file.

http://www.aemcasts.com/aem/episode-1.html

Avatar

Employee Advisor

Hi,

I would advice to switch over a full mavenized workflow. If you use the archtetypes as described in the documentation [1], it will create a structure, where the code (one or multiple bundles) are embedded into a content package. It's build in a way, that you can compile, build and deploy in a single step.

Jörg

 

[1] http://docs.adobe.com/docs/en/cq/current/developing/developmenttools/how-to-build-aem-projects-using...

Avatar

Former Community Member

Hi,

I followed the same link but doing so only allows me to package my code in one bundle..based on what I understand.

How do I have four bundles in the multi mode project, where do i place the code files apart from the one already in place.

Am I doing something wrong??

 

Regards,

Neha

Avatar

Former Community Member

Hi,

Thanks for a superb link, I actually have four bundles to package, how do i do that..?

 

Regards,

Neha

Avatar

Former Community Member

Hi,

I followed a different approach could anybody validate this as this behave in an erratic way.

  1. I create a “simple-content-package-archetype” project.
  2. I place all my bundle jars under install directory
  3. I install the package using the “autoInstallPackage” profile, the bundles get installed as expected.
  4. I create a page rendering component to make use of the “My" Services”
  5. I then create a template witch uses this component.
  6. The page works on a fresh installation, but if a failure occurs in any of the above steps, redoing the steps above does not guarantee its working e.g  say I did not install the bundles, the component does not render the page but throws error, re-installing the package with bundles does not solve the error.
  7. I try to sync the new package with the file system project using vlt.
  8.  I re-install the package using the “autoInstallPackage” profile.
  9. I see the same error in step 6.

ERROR(This usually occurs when the bundles do not get installed properly.)

org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 8 in the generated java file

Only a type can be imported. org.apache.sling.hc.util.HealthCheckFilter resolves to a package

 

Can anybody help me understand whats happening here.