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.
Solved! Go to Solution.
Views
Replies
Total Likes
<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
Views
Replies
Total Likes
<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
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes