1
votes

This is the scenario, I have a group of a AMPs, some developed by myself, and other developed by other developer/vendors.

If I am not wrong, using the Maven SDK I can develop and run only one specific AMP at a time.

What steps can be taken to have an external AMP being deployed along with the main project AMP at start up which is when running mvn integration-test -Pamp-to-war.

In particular I am interested in having Alfresco load the wcmqs module.

1

1 Answers

2
votes

Assuming you already have the external amps available to maven (either because their're on Maven Central repo or because they're installed locally), you simply add the external amps as dependencies in your amp project. E.g.:

<dependency>
    <groupId>org.sharextras</groupId>
    <artifactId>javascript-console-repo</artifactId>
    <version>0.6.0</version>
    <type>amp</type>
</dependency>

You also must configure the maven dependency plugin. You can do it in a profile so it can be turned on or off depending on your needs:

<profiles>
    <profile>
        <id>unpack-deps</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>

                    <executions>
                        <execution>
                            <id>unpack-amps</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>unpack-dependencies</goal>
                            </goals>
                            <configuration>
                                <includeTypes>amp</includeTypes>
                                <outputDirectory>${alfresco.client.war.folder}</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.alfresco.maven.plugin</groupId>
                            <artifactId>maven-amp-plugin</artifactId>
                            <version>3.0.2</version>
                        </dependency>

                    </dependencies>
                </plugin>

            </plugins>
        </build>
    </profile>
</profiles>

This way, you can start the main project amp plus its dependencies with the following command:

mvn integration-test -Pamp-to-war -Punpack-deps

For a complete pom.xml example see: https://github.com/douglascrp/alfresco-value-assistance/blob/master/alfresco-value-assistance-repo/pom.xml