wcm-io-devops / conga-aem-plugin

CONGA Plugin for Adobe Experience Manager (AEM)
https://devops.wcm.io/conga/plugins/aem/
Apache License 2.0
1 stars 5 forks source link

Package dependencies get lost in all package #59

Closed cnagel closed 1 year ago

cnagel commented 1 year ago

By default, the conga aem plugin adds dependencies to every sub package in the all-package to preserve an installation order. When a package contains a dependency to another package, the dependency gets overwritten.

This is reproducible with the wcm.io AEM archetype. Just add a package dependency from conf-content to sample-content. The conf-content package in the all-package has a dependency to adobe/consulting:acs-aem-commons-all:6.0.10 in the end.

With configuration <autoDependenciesMode>OFF</autoDependenciesMode> the dependency gets completely removed and the entry in the vault properties is empty: <entry key="dependencies"></entry>.

This causes problems when using the AECU cloud distribution 6.4. This contains two packages for the Groovy Console. Without dependencies, aem-groovy-console-ui.apps overwrites the content of aem-groovy-console-ui.apps.aem and the console is not usable anymore.

A first fix should prevent the deletion of package dependencies when configuration has <autoDependenciesMode>OFF</autoDependenciesMode>.

cnagel commented 1 year ago

I've debugged the plugin with the wcm.io archetype example. The dependency gets lost in the AllPackageBuilder.java.

~~Maybe we have to extend the if clause around it to if (existingDeps != null && dependencyFile != null) {. This should fix the <autoDependenciesMode>OFF</autoDependenciesMode> configuration and would not touch the default auto dependencies mode.~~

stefanseifert commented 1 year ago

By default, the conga aem plugin adds dependencies to every sub package in the all-package to preserve an installation order. When a package contains a dependency to another package, the dependency gets overwritten.

this is by design. when you use a AutoDependenciesMode other then OFF all existing references to packages that are managed by CONGA are removed, and replaced with the order in the conga role.

With configuration OFF the dependency gets completely removed and the entry in the vault properties is empty: .

this looks like a bug, probably a regression introduced during fine-tuning of the dependency management. those dependencies should be preserved, but may have to be rewritten if the references package name has changed (e.g. because of adding the runmode prefix).