0
votes

I'm using AEM 6.1 and using maven(3.3.3) to build and deploy projects. Whereas, the maven buiild installs my bundle package, with the java code. It is not copying my components and templates folder (in the apps folder).

I have added the paths in the filter.xml. Can someone provide me a sample POM or structure of how we can achieve copying of the components during the build?

Thanks!

1
you might be missing a maven resources plugin config, make sure that src/main/content/jcr_root is added as a resource and is available for packaging.awd

1 Answers

1
votes

Was your Maven project created from an archetype? If so, there should be a autoInstallPackage profile defined. I suspect you may be using autoInstallBundle, which would only install your OSGI bundle.

If it wasn't, you need to configure the content-package-maven-plugin to deploy the generated CRX package to a target instance.

There should be sufficient information in the official Adobe documentation for managing packages with Maven but here's a sample config from Lazybone's aem-multimodule-project by ACS Commons.

Specify the contents of your CRX package:

       <plugin>
            <groupId>com.day.jcr.vault</groupId>
            <artifactId>content-package-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <group>${packageGroup}</group>
                <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
                <embeddeds>
                    <embedded>
                        <groupId>${groupId}</groupId>
                        <artifactId>${bundleArtifactId}</artifactId>
                        <target>/apps/${appsFolderName}/install</target>
                    </embedded>
                </embeddeds>
                <targetURL>http://\${crx.host}:\${crx.port}/crx/packmgr/service.jsp</targetURL>
            </configuration>
        </plugin>

Specify a profile to use in order to install the package:

    <profile>
        <id>autoInstallPackage</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.day.jcr.vault</groupId>
                    <artifactId>content-package-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>install-content-package</id>
                            <phase>install</phase>
                            <goals>
                                <goal>install</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

Source: https://github.com/Adobe-Consulting-Services/lazybones-aem-templates/blob/master/templates/aem-multimodule-project/content/pom.xml