Nesting content (bundle) modules - content-package maven plugin | Community
Skip to main content
October 16, 2015
Solved

Nesting content (bundle) modules - content-package maven plugin

  • October 16, 2015
  • 5 replies
  • 1392 views

I have project which contains 3 content sub modules and 2 bundle sub modules. I want to pack all of them into one package which will contain 3 zips with content's module and 2 with jars. How to achieve this while using content-package maven plugin?

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh
<plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <extension>true</extension> <configuration> <group>myPackages</group> <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource> <properties> <aclHandling>overwrite</aclHandling> </properties> <embeddeds> <embedded> <groupId>com.example</groupId> <artifactId>myEmbeddedBundle</artifactId> <target>/apps/myAppp/install</target> </embedded> </embeddeds> <subPackages> <subPackage> <groupId>com.example</groupId> <artifactId>myEmbeddedContentPackage</artifactId> <filter>true</filter> </subPackage> </subPackages> </configuration> </plugin>

THis is a sample defintion for your pom. It embedds the bundle com.example:myEmbeddedBundle and the content package com.example:myEmbeddedContentPackage into the content package. You need to add the bundle and the contentpackage to the dependency section also.

HTH,

Jörg

5 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015
<plugin> <groupId>com.day.jcr.vault</groupId> <artifactId>content-package-maven-plugin</artifactId> <extension>true</extension> <configuration> <group>myPackages</group> <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource> <properties> <aclHandling>overwrite</aclHandling> </properties> <embeddeds> <embedded> <groupId>com.example</groupId> <artifactId>myEmbeddedBundle</artifactId> <target>/apps/myAppp/install</target> </embedded> </embeddeds> <subPackages> <subPackage> <groupId>com.example</groupId> <artifactId>myEmbeddedContentPackage</artifactId> <filter>true</filter> </subPackage> </subPackages> </configuration> </plugin>

THis is a sample defintion for your pom. It embedds the bundle com.example:myEmbeddedBundle and the content package com.example:myEmbeddedContentPackage into the content package. You need to add the bundle and the contentpackage to the dependency section also.

HTH,

Jörg

art_balAuthor
October 16, 2015

Thanks for help. This was what I needed.

But there raised another issue while subPackaging other modules. I got strange error while building project with content-package which has one subPackage called module-1 and got Package does not contain properties.xml error. When I go to this module and run mvn install package is building and there is properties.xml file in it. Only building from outside this module causes such problem... I have more modules subPackagged  but others were building fine.

Thanks for help in advance.

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

Hm, that's strange then. I would expect that the content-package-maven-plugin does not inspect the subpackages, but just includes them without further checks. So I don't know :-(

Jörg

art_balAuthor
October 16, 2015

Everything is clear right now.

I had some cached repos in my m2 repository.

Other question is: I have already a module with packaging bundle which contains logic and content as well. Do I have to separate this module into bundle and content and embedds bundle into content. Or maybe I can use content-package and and goal for maven to create bundle also for this module?

Thanks for help.

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

You cannot mix packaging "bundle" and packaging "content" in a maven module. You need to have 2 bundles then, and the content package can embedd the bundle.

Jörg