Deploying build artifacts

The plugin allows to deploy both arbitrary files and maven artifacts (dependencies). Files and artifacts to deploy can be specified via the deployArtifacts or deployFiles configuration, respectively.

For instance, once can configure the plugin to deploy a maven modules build result right out of the target folder, i.e. without installing it into the (local) maven repo:

 <plugin>
     <groupId>com.unic.maven.plugins</groupId>
     <artifactId>aem-maven-plugin</artifactId>
     <version>2.0.17-SNAPSHOT</version>
     <configuration>
         <deployFiles>
             <file>target/${project.build.finalName}.zip</file>
         </deployFiles>
     </configuration>
     <executions>
         <execution>
             <id>validate-content</id>
             <goals>
                 <goal>validate-content</goal>
             </goals>
             <phase>prepare-package</phase>
         </execution>
     </executions>
 </plugin>

Here, we have combined the deployment with the prior execution of validate-content to ensure that any CRX content we are deploying along with the app is syntactically valid.

If you wanted to deploy an arbitrary artifact instead, you could write:

 <plugin>
     <groupId>com.unic.maven.plugins</groupId>
     <artifactId>aem-maven-plugin</artifactId>
     <version>2.0.17-SNAPSHOT</version>
     <configuration>
         <deployArtifacts>
             <artifact>com.acme.groupId:artifactId:zip:${artifact.version}</artifact>
         </deployArtifacts>
     </configuration>
 </plugin>

Of course, files and artifacts can both be configured and will both be deployed during the invocation of

 mvn aem:deploy