An example Alfresco AMP project to demonstrate building with Gradle and the alfresco-gradle-plugins.
Java Groovy
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


An example Alfresco AMP project to demonstrate building with Gradle and the alfresco-gradle-plugins.

The resulting Share AMP adds an example JSP page that displays a message fetched from a Java class which reads the text from a properties file and the repository AMP displays a console message on startup.

While that's useless functionality, the project ties together many of the possible AMP deployment touch points and can serve as a guide or template for your project.

See the alfresco-gradle-plugins project for full details on use of the plugins.


The project currently requires that Gradle and Maven be installed.

A complied jar of the
alfresco-gradle-plugins project is included in lib-compile as a buildscript dependency by default, or you can use a version in your local Maven repository.

Packaging as an AMP

To package the AMP:

cd alfresco-gradle-amp-example
gradle amp

The packaged AMPs will be available at my-example-repo/build/distributions/my-example-repo-0.1.0.amp and my-example-share/build/distributions/my-example-share-0.1.0.amp.

Running Tests

To run the unit tests:

gradle test

and see the results with:

open my-example-repo/build/reports/tests/index.html


open my-example-share/build/reports/tests/index.html 

Installing the AMP

You can use the plugin to call on MMT to install the AMP in your WAR file:

gradle installAmp -PwarFile=/Path/To/WAR/File

Note that this should be run from each subproject or both AMPs would be installed in the same WAR file.

Viewing the Example

The endpoint depends on your environment and where you've installed the AMP but here's an example URL for seeing confirmation of the share AMP changes:


Watch the startup logs of your repo instance for a message indicating the repo AMP is present.


Copyright (C) 2005-2012 Alfresco Software Limited.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.