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

Avatar

Avatar

akaria

Avatar

akaria

akaria

18-08-2020

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

kalyan_venkat

Avatar

kalyan_venkat

kalyan_venkat

18-08-2020

@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  

Answers (0)