Deploying JAR to alfresco server

Showing results for 
Search instead for 
Did you mean: 
Member II

Deploying JAR to alfresco server


I followed this guide: to successfully create a maven project to run it on Docker. I created a simple worklflow that checks if a documentation is valid. 

Now I wanted to create a Listener which will trigger after some step is completed I added this code to my process.bpmn20.xml:

<activiti:taskListener event="complete" class="com.someco.platformsample.CompleteListener"></activiti:taskListener>

Then i created a CompleteListener class:

Logger logger = Logger.getLogger(CompleteListener.class);
public void notify(DelegateTask delegateTask){
// TODO Auto-generated method stub
LocalDateTime myDateObj =;
System.out.println("Before formatting: " + myDateObj);
DateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss");

String formattedDate = myDateObj.format(myFormatObj);
System.out.println("After formatting: " + formattedDate);

try {
} catch (Exception e) {
// TODO Auto-generated catch block

When i redeployed the project and tried it out it didn't work - nothing happened. I then read somewhere you need to export the listener class (in this case as a JAR and deploy it in /usr/local/tomcat/webapps/alfresco/WEB-INF/lib/. 

Now I have a running docker container which has two images: alfresco-content-services-maven-sdk-tutorial and alfresco-share-sdk-tutorial. To be honest I didn't use Docker before and i am pretty lost. However i inspected both images and saw that alfresco-content-services-maven-sdk-tutorial has the /usr/local/tomcat/webapps/alfresco/WEB-INF/lib/ folder so I guess I have to deploy the JAR here. Can someone explain to me how this can be done? Once again the end result should be that the CompleteListener is deployed on the server and that the workflow will recognize it and trigger the code I have in the class - which will Log something to me.

2 Replies
Member II

Re: Deploying JAR to alfresco server

To add on top of this I found a similar question asked here:  Hower i don't seem to understand, do i need to get the whole jar of the whole project (with platform, share and both dockers) or only that one class. And when I use command : 

docker build -t alfresco-content-services-maven-sdk-tutorial -f AddListener.DockerFile . --no-cache

Where alfresco-content-services-maven-sdk-tutorial is an Image and AddListener.DockerFile is a dockerFile which contains code to COPY file to /usr/local/tomcat/webapps/alfresco/WEB-INF/lib/ . All that does is it builds me another image, but it seems its not used when i redeploy the project... So what am I doing wrong here.. ?


Re: Deploying JAR to alfresco server

Are you using sdk for your development ? if yes which version of SDK ?

For docker based deployment you should be using SDK4.1 and if you are already using it, you don't have to do all these steps that you are trying. 

Check this project here from the same tutorial:

Suppose you are creating your workflow in platform project e.g. ,

All you need to do is that execute run.bat/ script. 


run.bat build_start
or build_start

It will launch all the containers with updated extensions locally on your docker desktop environment.


If you have a server setup that is not based on docker deployments, then you have to copy your platform-extensions (amps, jars)  to the server under $TOMCAT_HOME/webapps/alfresco/WEB-INF/lib and share-extensions (amps, jars) under $TOMCAT_HOME/webapps/share/WEB-INF/lib

Note, that with this approach all your copied extensions will be lost if you terminate your containers.

These threads may also be helpful:

If your server is docker containers based, then i would suggest to make use of DockerFile and docker-compose.yml in combination and launch your server. It will build the updated images with your custom extensions and launch all the services as configured in docker-compose.yml.


Check the steps here if you want to persue DockerFile and docker-compose based approach:



(ACSCE, AWS SAA, Azure Admin)