Alfresco 6 Deploy jar

cancel
Showing results for 
Search instead for 
Did you mean: 
sanjaybandhniya
Intermediate

Alfresco 6 Deploy jar

Jump to solution

I have installed alfresco 6 using docker and its working.

I have made some customization and I want to deploy that as jar in alfresco.

How can I deploy that?

2 Solutions

Accepted Solutions
abhinavmishra14
Advanced

Re: Alfresco 6 Deploy jar

Jump to solution

It would be better if you could use SDK to build the image with your customization within. Else you will have to manually deploy the jar files/amps/configs every time. 

If you attempting to apply amps, You can copy your amp file directly to "$TOMCAT_DIR/amps (/usr/local/tomcat/amps)" and try if that works. 

This is what you would see in $TOMCAT_DIR/amps. A Dockerfile and some amps. 

If you open Dockerfile in editor, you can see it is trying to apply all the amps:

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

playerro
Active Member

Re: Alfresco 6 Deploy jar

Jump to solution

All is working, thanks!

View solution in original post

15 Replies
kerkhofsd
Active Member II

Re: Alfresco 6 Deploy jar

Jump to solution

See the Alfresco documentation for Alfresco Simple Module's:

Simple Modules are located in the modules/platform or modules/share folder of your Alfresco Content Services installation, depending on whether they are an extension for Platform or Share respectively.

An alternative is adding the jar inside the unpacked Alfresco application, in the following directory:

$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/

The Alfresco Maven SDK 4 is using the latter approach. (See: Maven SDK 4 docker file)

If you generate your customization project with the Alfresco Maven SDK 4, you'll have a full test docker setup available. 

If you are using Gradle as a build tool, you can use the Alfresco Docker Gradle Plugin to easily build custom docker images with Simple Modules / Module Packages installed. 

sanjaybandhniya
Intermediate

Re: Alfresco 6 Deploy jar

Jump to solution

I have followed this instruction. https://docs.alfresco.com/6.0/tasks/deploy-docker-compose.html

At which location  modules/platform or modules/share will generate?I am using linux.

kerkhofsd
Active Member II

Re: Alfresco 6 Deploy jar

Jump to solution

It looks like those paths aren't available inside the container. 

I would suggest adding your extension to 

$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib/

sanjaybandhniya
Intermediate

Re: Alfresco 6 Deploy jar

Jump to solution

In which file and where I need to add?

abhinavmishra14
Advanced

Re: Alfresco 6 Deploy jar

Jump to solution

If you are using SDK4.0.0 and made the custom changes in your code. Then stop the container using ./run.sh stop command

then execute the ./run.sh build_start command again. 

If you are using AIO project structure then you have option to refresh the Alfresco and Share individually to load latest changes.

See ./run.bat or ./run.sh file for more commands.   

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
abhinavmishra14
Advanced

Re: Alfresco 6 Deploy jar

Jump to solution

It you are not using SDK, then probably you have to ftp your customizations to container and copy them to <tomcat_InstallDir>/webapps/alfresco/WEB-INF/lib directory for repo layer changes and <tomcat_InstallDir>/webapps/share/WEB-INF/lib directory for share layer changes. 

Additionally you can copy the extension to <tomcatInstallDir>/shared/classes/alfresco/extension (repo layer)

<tomcatInstallDir>/shared/classes/alfresco/web-extension (share)

folders.

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
sanjaybandhniya
Intermediate

Re: Alfresco 6 Deploy jar

Jump to solution

Jar deployment approach available or not?

abhinavmishra14
Advanced

Re: Alfresco 6 Deploy jar

Jump to solution

JAR and AMP both options are available. It depends which way you have setup your environment. If you are using SDK, it would be easily deployed like mentioned above.

Else copy the jar files manually "$TOMCAT_DIR/webapps/alfresco/WEB-INF/lib (e.g. /usr/local/tomcat/webapps/alfresco/WEB-INF/lib) directory for repo layer changes and $TOMCAT_DIR/webapps/share/WEB-INF/lib  (e.g. /usr/local/tomcat/webapps/share/WEB-INF/lib) directory for share layer changes"

Method 1:

Execute following commands from powershell, i am just trying to show how to copy a file to container. Same way you can copy jar files. 

#Get container name or short container id:

- docker ps

#Get full container id:

- docker inspect -f '{{.Id}}' SHORT_CONTAINER_ID-or-CONTAINER_NAME

Example: ac23e51fd0b5c4cc11a12133ceea16d603e7f105d8d39873c75d7cfdd5942e40

#Copy file:

- docker cp localFile FULLCONTAINER_IDSmiley TongueathOnContainer

Example:
- docker cp C:\custom-log4j.properties ac23e51fd0b5c4cc11a12133ceea16d603e7f105d8d39873c75d7cfdd5942e40:/usr/local/tomcat/shared/classes/alfresco/extension

Once you are done copying the file, restart the container.  

Method 2:

SSH into the container and copy the jar file as needed....

#Get container name or short container id:

- docker ps

#SSH into the container using container name or container id

- docker exec -t -i docker_acs6-aio-demo-project-acs_1 /bin/bash

You can execute all Linux commands here... i am logged into alfresco container. Once you are done copying file into alfresco container, do the same steps as given above for share to copy your customization. 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
playerro
Active Member

Re: Alfresco 6 Deploy jar

Jump to solution

Same question. What path to upload simple module (with config, META-INF folders etc) into the alfresco docker container?