What is the proper way to add jar to amp

cancel
Showing results for 
Search instead for 
Did you mean: 
mangar
Established Member II

What is the proper way to add jar to amp

Jump to solution

I am using ACS 7,  and creating my own custome Docker image.  I used the AIO as a starting point,  and I can create an amp with all my customaizatrions in it.  I can create a image, and start it up. 

One of my customizations is to use a local MySql.   But the JDBC driver cannot be found.

What is the right way to get the mysql jar into my image?

I can copy it in the docker file if I use the meven-dependency plugin,  but that copies ALL of the dependencies,  which I assume are already on the alfresco-acs base docker image. 

What is the correct way to do this?

1 Solution

Accepted Solutions
dougforrest
Member II

Re: What is the proper way to add jar to amp

Jump to solution

The database driver jar file should not go in your amp. Have a look at the following pom.xml file:

https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/pom.xml

This is the pom file that puts together the community repo docker image. You'll notice that there is an execution plugin called "copy-jdbc-connectors". It simply copies the postgres jar file into a directory called "connectors" (under the "target" directory). And then in the Dockerfile:

https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/Dockerfile

You can see that the contents of that "connector" directory get copied into the tomcat/lib directory:

COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/

You can follow this pattern if you like and simply copy the jar using an execution plugin and then copy it into your Dockerfile. Or you can use any other process that results in the jar file being copied into the tomcat lib dir in your docker image.

-Doug

View solution in original post

2 Replies
dougforrest
Member II

Re: What is the proper way to add jar to amp

Jump to solution

The database driver jar file should not go in your amp. Have a look at the following pom.xml file:

https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/pom.xml

This is the pom file that puts together the community repo docker image. You'll notice that there is an execution plugin called "copy-jdbc-connectors". It simply copies the postgres jar file into a directory called "connectors" (under the "target" directory). And then in the Dockerfile:

https://github.com/Alfresco/alfresco-community-repo/blob/master/packaging/docker-alfresco/Dockerfile

You can see that the contents of that "connector" directory get copied into the tomcat/lib directory:

COPY ${resource_path}/connector/* ${TOMCAT_DIR}/lib/

You can follow this pattern if you like and simply copy the jar using an execution plugin and then copy it into your Dockerfile. Or you can use any other process that results in the jar file being copied into the tomcat lib dir in your docker image.

-Doug

EddieMay
Alfresco Employee

Re: What is the proper way to add jar to amp

Jump to solution

Hi @mangar 

Great that you found a resolution to your problem and thanks for accepting this solution - it will help other users out who have the same problem.

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!