icfnext / cq-component-maven-plugin

Other
22 stars 35 forks source link

Documentation of required maven structure #49

Open brennhill opened 7 years ago

brennhill commented 7 years ago

There seems to be some dependency on how your maven project is setup. E.g. if you have a backend module and FE module, in which module should you declare the plugin and dependencies?

I'll happily update the docs but I haven't been able to figure this out.

pmichelotti commented 7 years ago

Hi @brennhill - thanks for the feedback and sorry for the extremely delayed response. http://code.digitalatolson.com/cq-component-maven-plugin/configuration.html calls out the configuration needed and http://code.digitalatolson.com/cq-component-maven-plugin/usage.html speaks to the phase where it needs to be executed. Given that it is intended to modify the package that is to be deployed it needs to be run somewhere after that package has been created but before it has been deployed. We typically run it in the front end / ui module in a typical multi module setup.

Is there any particular update you would suggest to the documentation that would help clarify this?

Pushparajan commented 7 years ago

May be this is trivial, I have a AEM project with Archetype 10. I have updated the top level pom with the configurations mentioned.

jcr_root/apps/aempackage/components content Client Group camel-case true

I get the following exception,

com.citytechinc.cq.component.dialog.exception.OutputFailureException: Archive file does not exist at com.citytechinc.cq.component.maven.util.ComponentMojoUtil.buildArchiveFileForProjectAndClassList(ComponentMojoUtil.java:207) at com.citytechinc.cq.component.maven.ComponentMojo.execute(ComponentMojo.java:126) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

Can you please clarify the right path

Thanks Pushparajan

schananas commented 7 years ago

@Pushparajan hi, I had same problem and lots of problem to figure out whats wrong.

This is how plugin work: after maven-packutil-plugin creates zip crx package, before its deployed, this plugin unpacks it and add dialog xml files, and zip it again.

"Archive file does not exist" occurs when this zip crx package is not found.

  1. Check the target folder in the project where u defined plugin to see if actual zip is generated or not
  2. If file is there but u still get error message its because this plugin has "bug", its searching for this zip taking and parametars from pom.xml and forms the name eg: content-1.1-SNAPSHOT.zip, but in some cases (like mine), there is and its diffrent from , in my case it was nameOfApp-content-1.1-SNAPSHOT.zip, and this plugin is still searching for content-1.1-SNAPSHOT.zip, it can't be found so it throws an error...

Solution is simple, just rename final name in the pom.xml

Pushparajan commented 7 years ago

Thanks,@stefanvozd I did figure that. I have started changing a bit, not to read or write to archive but to generate to project folders. additionally, I have added code to generate an htl page