How to deploy changes to java file into AEM?

放肆的年华 提交于 2019-12-13 02:03:37

问题


I'm working with AEM for the first time. I am using Adobe Brackets for editing one of the ZIP files I was given that included jcr_root and META-INF. This ZIP file has no pom.xml. Everything so far is fine with the zip file....I can make changes to JSP and JS etc. and they take effect right away.

However, I would like to change one of the java files. The change to JAVA files doesn't seem to be taking effect. I've restarted CQ instance but that doesn't seem to be working. And there is no POM.xml in the zip file.

There is a .bnd file with these contents. Not sure if this helps..

Export-Package: *
Import-Package: *
#Private-Package: com.acme.demo.workflow.impl
# Include-Resource: 
Bundle-Name: com.acme.demo.workflow
Bundle-Description: 
Bundle-SymbolicName: com.acme.demo.workflow
Bundle-Version: 1.0.0-SNAPSHOT
Bundle-Activator: com.acme.demo.workflow.Activator

Question

Can compiled class files be sent to AEM via brackets? If so, how?


回答1:


I strongly recommend to use Maven to build your AEM Project. It's very well supported and documented and the de-facto standard for AEM deployment. http://docs.adobe.com/docs/en/cq/5-6-1/developing/developmenttools/how-to-build-aem-projects-using-apache-maven.html




回答2:


I prefer you to use Eclipse IDE, follow next steps: Use maven command on bundle's pom.xml file

  1. rightclick on pom.xml file of bundle.
  2. Run as.
  3. Run configurations.
  4. In Base derictory field browse package of your bundle.
  5. In Goals field

Put this string

install org.apache.sling:maven-sling-plugin:install -Dsling.url=http://SERVERNAME/system/console/install -Dsling.user=admin -Dsling.password=admin

Press Run button and yours bundle will be installed to CRX

You can check if bundle installed using link

http://SERVENAME/system/console/bundles



回答3:


The surest way is through maven only. At the parent pom's directory level hit -

Definitely fast and reliable. Although it is not advisable to disable tests everytime.



来源:https://stackoverflow.com/questions/29689454/how-to-deploy-changes-to-java-file-into-aem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!