AnsweredAssumed Answered

Prefered way to handle AMP dependencies in Maven SDK?

Question asked by arnoldschrijver on Aug 6, 2013
Latest reply on Jun 20, 2014 by vince20151
I am in the process of converting our own Alfresco Maven projects to use the Maven SDK and am wondering what is the best way for one AMP to depend on another in a way that Java code also works. The AMP dependency in the POM is not sufficient.
According to Josh Barret in <a href="http://josh-barrett.blogspot.nl/2012/10/amps-vs-jars-for-alfresco-customizations_3605.html">this 2012 blog post</a> this is a major flaw of the AMP design above packaging as JAR. Is this not solved in the Maven SDK, I couldn't find it in the documentation?

What I am now doing to tackle this is use the build-helper-maven-plugin like this:


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.artifactId}/lib/${project.artifactId}.jar</file>
                                    <type>jar</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Outcomes