Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Unable to modify package properties and build the package - AEM archetype 22

akaria
Level 2
Level 2

Hi all,

 

I created an AEM project with Maven archetype 22,

AEM version is 6.5, and JDK version is 11.0.7.

 

I would like to modify the following package properties and build the package (for contents under ui.apps and ui.content):
(1) package name
(2) package filter

  • More specific path like /apps/project-name/components/content/something/something
  • Add other paths outside /apps such as /etc/designs/clientlibs

(3) package group

 

I managed to change the package version by running this command, build works as well:

 

mvn versions:set -DnewVersion=1.X.X -DgenerateBackupPoms=false

 

I've tried:

  • Editing filter.xml (under: ui.apps/src/main/content/META-INF/vault) then run the `mvn clean package` command, but the build fails
  • Editing properties.xml (under: ui.apps/src/main/content/META-INF/vault) then run the `mvn clean package` command, build passes, but the changes I made are overwritten to default ones

 

Is it possible to modify package properties when we use AEM archetype?

 

Please let me know if there's a better way!
Thanks in advance 🙂

 

**Partially solved**

 

Hi, @kalyan_venkat

 

Thanks for helping me out!

By editing pom.xml under ui.apps, I can successfully modify these properties, and the build works!

  • package name
  • package group
  • package description

Here's the very first state of the filter.xml (ui.apps/src/main/content/META-INF/vault), right after generating AEM project:

 

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

 

Edited filter.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
 <filter root="/apps/smtg"/>
 <filter root="/apps/smtg/components/items/title"/>
 <filter root="/etc/designs"/>
</workspaceFilter>

 

The above paths are valid, since the contents are stored in the said locations under ui.apps/src/main/content/jcr_root.

I managed to build the package by editing the pom.xml under repository-structure module, by adding another filter root for /etc:

 

<filter><root>/apps</root></filter>
<filter><root>/etc</root></filter>

 

While figuring out, I also noticed that if I erase the first filter root (/apps/smtg), build fails:

 

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
 <filter root="/apps/smtg/components/items/title"/>
 <filter root="/etc/designs"/>
</workspaceFilter>

 

Here's the error message I got:

 

[ERROR] Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) on project com.smtg.smtg.ui.apps: 1 error(s) detected during dependency analysis. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.jackrabbit:filevault-package-maven-plugin:1.0.3:generate-metadata (default-generate-metadata) on project com.smtg.smtg.ui.apps: 1 error(s) detected during dependency analysis.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: 1 error(s) detected during dependency analysis.
    at org.apache.jackrabbit.filevault.maven.packaging.GenerateMetadataMojo.validateDependencies (GenerateMetadataMojo.java:617)
    at org.apache.jackrabbit.filevault.maven.packaging.GenerateMetadataMojo.execute (GenerateMetadataMojo.java:428)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347

 

The problem here is, I can't specify the contents to be included in the package if I keep the first filter root (/apps/smtg) written in filter.xml, everything under /apps/smtg is included for the moment.

Any ideas?

AEM 6.5 Archetype build filter filters JDK11 maven package packages pom.xml Properties
1 Accepted Solution
kalyan_venkat
Correct answer by
Level 3
Level 3

@akaria To change your package name and group try to find out "filevault-package-maven-plugin"  in you ui.apps package and update the <configuration> section. Package name and description is derived from artifact id and description if not specified in the filevault-package-maven-plugin configuration. For your reference on all the available configuration go to this link http://jackrabbit.apache.org/filevault-package-maven-plugin-archives/1.0.0/package-mojo.html

 

For allowing specific paths you can update in filter.xml file but seems like you are getting build errors. Could you please share the build failure error message so that we can try to help  

View solution in original post

4 Replies
kalyan_venkat
Correct answer by
Level 3
Level 3

@akaria To change your package name and group try to find out "filevault-package-maven-plugin"  in you ui.apps package and update the <configuration> section. Package name and description is derived from artifact id and description if not specified in the filevault-package-maven-plugin configuration. For your reference on all the available configuration go to this link http://jackrabbit.apache.org/filevault-package-maven-plugin-archives/1.0.0/package-mojo.html

 

For allowing specific paths you can update in filter.xml file but seems like you are getting build errors. Could you please share the build failure error message so that we can try to help  

View solution in original post

kalyan_venkat
Level 3
Level 3
Hi @akaria If you have repository-structure module then try to match the filter.xml paths with it. Make sure repository structure has all the paths defined from its parents for example if you have /etc/designs/app-name then you should define root for each intermediate path like /etc, /etc/designs, /etc/designs/app-name. Please refer this url that explains about repository-structure module for AEM as cloud but it is valid for archetype 22 as far as i know https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/developing/repo...
akaria
Level 2
Level 2
Hi @kalyan_venkat, I've added all intermediate paths and the build works as I desired! Thank you very much!