/conf folde under ui.apps is not working

Avatar

Avatar

dipu2

Avatar

dipu2

dipu2

10-12-2020

Dear All,

 

I have added conf folder in my ui.apps , as shown in below.

 

dipu2_0-1607609804263.png

 

And also I have updated my filter.xml file as below.

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/apps/sunitaproject"/>
<filter root="/conf/sunitaproject"/>
</workspaceFilter>

 

But when I am running my ui.apps , then I am getting below error.

 

Filter root's ancestor '/conf' is not covered by any of the specified dependencies.

Accepted Solutions (0)

Answers (8)

Answers (8)

Avatar

Avatar

shelly-goel

MVP

Avatar

shelly-goel

MVP

shelly-goel
MVP

13-12-2020

Hi @dipu2 

It is recommended to manage the /conf changes as part of "content" package rather than "apps" package as it includes configurations/ editable templates which is mutable and runtime writable areas whereas "apps" package manages code i.e. /apps or /libs which are immutable and cannot be changed at runtime after AEM deployment.

While it's preferable to keep code and content separate, if you still want to move a specific /conf folder to apps package and using latest archetype 24, it will involve below changes:

1. Add "validRoots" section under filevault-package-maven-plugin in ui.apps pom.xml

<jackrabbit-filter>
<options>
<validRoots>/conf</validRoots>
</options>
</jackrabbit-filter>

2. filter.xml to have specific filter root for your folder with mode "merge" (so that existing content under it is not overwritten)

<filter root="/conf/<yourfolder>" mode="merge"/>

Hope this helps.

 

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

12-12-2020

@dipu2 

for a working example, start a new aem project using the aem maven archteype. next, build the code. Check /content/conf/my-project, and you should see the default settings as applied. Following the best practice for how to store /conf in the code, the aem maven archetype project is storing these configuration in the ui.content maven module; because this content is intended for content changes. Once your new AEM project builds successfully into your local, you will use the new aem archtype project, and pretty much mimic how everything is setup.

I hope this helps,

Brian.

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883
Arun_Patidar
MVP

11-12-2020

I would suggest to move conf inside ui.content package.

Avatar

Avatar

Ankur_Khare

MVP

Avatar

Ankur_Khare

MVP

Ankur_Khare
MVP

10-12-2020

Hi,

 

Could you please let us know any specific reason to place under apps?

Avatar

Avatar

dipu2

Avatar

dipu2

dipu2

10-12-2020

Hi Shaileshb584084 ,

 

Whatever the solution you provided is not a valid solution. After implementing this solution when I am build myproject it is deleting all other conf folders in my Local.

 

Before build the screenshot is below.

 

test.png

 

After putting the <filter><root>/conf</root></filter> in ui.apps/pom.xml my all the folder from conf is deleting , as shown below.

 

 

test2.PNG

 

<!-- ====================================================================== -->
<!-- V A U L T P A C K A G E P L U G I N S -->
<!-- ====================================================================== -->
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>com.myproject</group>
<name>myproject.ui.apps</name>
<packageType>application</packageType>
<accessControlHandling>merge</accessControlHandling>
<properties>
<cloudManagerTarget>none</cloudManagerTarget>
</properties>

<filters>
<filter><root>/conf</root></filter>
</filters>

<!-- <repositoryStructurePackages>
<repositoryStructurePackage>
<groupId>com.myproject</groupId>
<artifactId>myproject.ui.apps.structure</artifactId>
</repositoryStructurePackage>
</repositoryStructurePackages> -->

<embeddeds>
<embedded>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<target>/apps/myproject/install</target>
</embedded>
<embedded>
<groupId>com.myproject</groupId>
<artifactId>myproject.core</artifactId>
<target>/apps/myproject/install</target>
</embedded>
</embeddeds> 

Avatar

Avatar

dipu2

Avatar

dipu2

dipu2

10-12-2020

Hi,

 

I am getting the below error while build the project in eclipse, as shown below.

 

Packages used in the analyzed classes:
------------------------------
com.myproject.core.models;version="[1.0.0,2.0.0)"
org.apache.sling.scripting.sightly;version="[2.0.0,3.0.0)"
org.apache.sling.scripting.sightly.render;version="[3.0.0,4.0.0)"

[INFO]
[INFO] --- filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) @ myproject.ui.apps ---
[INFO] Embedding --- Embedded: groupId=com.adobe.cq,artifactId=core.wcm.components.core,type=,classifier=,filter=false,excludeTransitive=false,target=/apps/myproject/install/ ---
[INFO] Embedding com.adobe.cq:core.wcm.components.core:jar:2.8.0 (from C:\Users\sunita_c\.m2\repository\com\adobe\cq\core.wcm.components.core\2.8.0\core.wcm.components.core-2.8.0.jar) -> jcr_root/apps/myproject/install/core.wcm.components.core-2.8.0.jar
[INFO] Embedding --- Embedded: groupId=com.myproject,artifactId=myproject.core,type=,classifier=,filter=false,excludeTransitive=false,target=/apps/myproject/install/ ---
[INFO] Embedding com.myproject:myproject.core:jar:1.0-SNAPSHOT (from C:\Users\sunita_c\.m2\repository\com\myproject\myproject.core\1.0-SNAPSHOT\myproject.core-1.0-SNAPSHOT.jar) -> jcr_root/apps/myproject/install/myproject.core-1.0-SNAPSHOT.jar
[INFO] using meta-inf/vault from C:\Users\sunita_c\Kohler-Sunita-Work\ADOBE-FOUNDATION-CODES\New folder\myproject\ui.apps\src\main\content\META-INF\vault
[INFO] Loading filter from C:\Users\sunita_c\Kohler-Sunita-Work\ADOBE-FOUNDATION-CODES\New folder\myproject\ui.apps\src\main\content\META-INF\vault\filter.xml
[INFO] Merged detected packages from analyzer with 'importPackage':
[INFO] com.myproject.core.models;version="[1.0.0,2.0.0)"
[INFO] org.apache.sling.scripting.sightly;version="[2.0.0,3.0.0)"
[INFO]
[ERROR] 1 error(s) detected during dependency analysis.
[ERROR] Filter root's ancestor '/conf' is not covered by any of the specified dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.117 s
[INFO] Finished at: 2020-12-10T22:04:58+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) on project myproject.ui.apps: 1 error(s) detected during dependency analysis. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

*****************************************************************************

My project structure is below.

 

dipu2_0-1607621523369.png

 

Avatar

Avatar

shaileshb584084

Avatar

shaileshb584084

shaileshb584084

10-12-2020

In the AEM Maven archetype 22 there is a module called repository-structure. The module's description says it all:

Empty package that defines the structure of the Adobe Experience Manager repository the Code packages in this project deploy into.
Any roots in the Code packages of this project should have their parent enumerated in the Filters list below.

You have to define the /conf as "root":

<build>
<plugins>
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<properties>
<cloudManagerTarget>none</cloudManagerTarget>>
</properties>
<filters>

<!-- /apps root -->
<filter><root>/apps</root></filter>

<!-- Common overlay roots -->
<filter><root>/apps/sling</root></filter>
<filter><root>/apps/cq</root></filter>
<filter><root>/apps/dam</root></filter>
<filter><root>/apps/wcm</root></filter>
<filter><root>/apps/msm</root></filter>

<!-- Immutable context-aware configurations -->
<filter><root>/apps/settings</root></filter>

<filter><root>/conf</root></filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>

Now building the view (or ui.apps) module in which /conf is treated like a code folder, e.g. for editable templates, the Maven build will work with no errors.

 

Thanks

dipu2

Hi Shaileshb584084 ,

 

Whatever the solution you provided is not a valid solution. After implementing this solution when I am build myproject it is deleting all other conf folders in my Local.

 

Before build the screenshot is below.

 

test.png

 

After putting the <filter><root>/conf</root></filter> in ui.apps/pom.xml my all the folder from conf is deleting , as shown below.

 

 

test2.PNG

 

<!-- ====================================================================== -->
<!-- V A U L T P A C K A G E P L U G I N S -->
<!-- ====================================================================== -->
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<group>com.myproject</group>
<name>myproject.ui.apps</name>
<packageType>application</packageType>
<accessControlHandling>merge</accessControlHandling>
<properties>
<cloudManagerTarget>none</cloudManagerTarget>
</properties>

<filters>
<filter><root>/conf</root></filter>
</filters>

<!-- <repositoryStructurePackages>
<repositoryStructurePackage>
<groupId>com.myproject</groupId>
<artifactId>myproject.ui.apps.structure</artifactId>
</repositoryStructurePackage>
</repositoryStructurePackages> -->

<embeddeds>
<embedded>
<groupId>com.adobe.cq</groupId>
<artifactId>core.wcm.components.core</artifactId>
<target>/apps/myproject/install</target>
</embedded>
<embedded>
<groupId>com.myproject</groupId>
<artifactId>myproject.core</artifactId>
<target>/apps/myproject/install</target>
</embedded>
</embeddeds> 

Avatar

Avatar

sudheersundalam

Avatar

sudheersundalam

sudheersundalam

10-12-2020

Hi,

Do you mean that when you build your ui.apps module, you are not seeing the /conf/<project> deployed to AEM instance? Can you please show more logs here?

dipu2
Hi,
dipu2

Hi,

 

I am getting the below error while build the project in eclipse, as shown below.

 

Packages used in the analyzed classes:
------------------------------
com.myproject.core.models;version="[1.0.0,2.0.0)"
org.apache.sling.scripting.sightly;version="[2.0.0,3.0.0)"
org.apache.sling.scripting.sightly.render;version="[3.0.0,4.0.0)"

[INFO]
[INFO] --- filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) @ myproject.ui.apps ---
[INFO] Embedding --- Embedded: groupId=com.adobe.cq,artifactId=core.wcm.components.core,type=,classifier=,filter=false,excludeTransitive=false,target=/apps/myproject/install/ ---
[INFO] Embedding com.adobe.cq:core.wcm.components.core:jar:2.8.0 (from C:\Users\sunita_c\.m2\repository\com\adobe\cq\core.wcm.components.core\2.8.0\core.wcm.components.core-2.8.0.jar) -> jcr_root/apps/myproject/install/core.wcm.components.core-2.8.0.jar
[INFO] Embedding --- Embedded: groupId=com.myproject,artifactId=myproject.core,type=,classifier=,filter=false,excludeTransitive=false,target=/apps/myproject/install/ ---
[INFO] Embedding com.myproject:myproject.core:jar:1.0-SNAPSHOT (from C:\Users\sunita_c\.m2\repository\com\myproject\myproject.core\1.0-SNAPSHOT\myproject.core-1.0-SNAPSHOT.jar) -> jcr_root/apps/myproject/install/myproject.core-1.0-SNAPSHOT.jar
[INFO] using meta-inf/vault from C:\Users\sunita_c\Kohler-Sunita-Work\ADOBE-FOUNDATION-CODES\New folder\myproject\ui.apps\src\main\content\META-INF\vault
[INFO] Loading filter from C:\Users\sunita_c\Kohler-Sunita-Work\ADOBE-FOUNDATION-CODES\New folder\myproject\ui.apps\src\main\content\META-INF\vault\filter.xml
[INFO] Merged detected packages from analyzer with 'importPackage':
[INFO] com.myproject.core.models;version="[1.0.0,2.0.0)"
[INFO] org.apache.sling.scripting.sightly;version="[2.0.0,3.0.0)"
[INFO]
[ERROR] 1 error(s) detected during dependency analysis.
[ERROR] Filter root's ancestor '/conf' is not covered by any of the specified dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.117 s
[INFO] Finished at: 2020-12-10T22:04:58+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) on project myproject.ui.apps: 1 error(s) detected during dependency analysis. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

*****************************************************************************

My project structure is below.

 

dipu2_0-1607621523369.png