There are fundamentally 3 methods to use this plugin:
Two sample archetypes already use the plugin and provide best practice example on how to use it:
This is the recommended and less error-prone way of using the plugin.
The Maven Alfresco SDK Parent POM provides a single entry point for all SDK features.
By using it as parent as follows:
<project> ... <parent> <groupId>org.alfresco.maven</groupId> <artifactId>alfresco-sdk-parent</artifactId> <version>1.0</version> </parent> ... </project>
you will have automatic support for AMP packaging of your project (just add you sources in src/main/amp).
If you want more control over the plugin behavior you can use it directly in your POM.
NOTE: The following configuration is not required when using the SDK parent, as it's already included there.
In order to manage AMP artifacts with the Alfresco Maven plugin you need to:
<project> [...] <build> <plugins> ... <plugin> <groupId>org.alfresco.maven.plugin</groupId> <artifactId>alfresco-maven-plugin</artifactId> <version>1.1.0</version> <extensions>true</extensions> </plugin> ... </plugins> </build> [...] </project>
<project> [...] <build> <resources> ... <resource> <directory>src/main/amp</directory> <!-- This is relative to ${project.build.outputDirectory} --> <targetPath>../${project.build.finalName}</targetPath> <filtering>${app.filtering.enabled}</filtering> </resource> </resources> </build> [...] </project>