You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by to...@googlemail.com.INVALID, to...@googlemail.com.INVALID on 2021/10/11 19:27:15 UTC

Maven extensions and shared code

Hi,

Is there a possibility that several extensions share code without having to install it in the maven/lib directory?

I want to use maven in Docker for a build and don't see the possibility of installing jars before the build starts.

In my case a common code base is necessary because several extensions implement ModelProcessor.

Thanks for hints
Torsten




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven extensions and shared code

Posted by je...@gmail.com.
Hey,

There might be other ways to do this but what I did was I built a custom
image with some special configuration. You could also try mounting a volume
to the /lib directory (something like
https://stackoverflow.com/questions/47519309/mount-an-empty-folder-in-host-to-a-non-empty-folder-in-docker).
Here is the Dockerfile I use for the named locks with redisson (most jars
are omitted for clarity) :
FROM maven:3.8.1-openjdk-11-slim

RUN mkdir -p /usr/share/maven/lib/ext/redisson/
RUN sed -i '/.*${maven.conf}\/logging/a load
${maven.home}/lib/ext/redisson/*.jar' usr/share/maven/bin/m2.conf

RUN wget -P /usr/share/maven/lib/ext/redisson/
https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy/1.10.7/byte-buddy-1.10.7.jar

So I build an image with this and push it to a repository (docker hub, ECR,
etc.) and use it in my CI instances.

On Tue, Oct 12, 2021 at 2:09 AM torsten.liermann@googlemail.com.INVALID
<to...@googlemail.com.invalid> wrote:

> Hi,
>
> Is there a possibility that several extensions share code without having
> to install it in the maven/lib directory?
>
> I want to use maven in Docker for a build and don't see the possibility of
> installing jars before the build starts.
>
> In my case a common code base is necessary because several extensions
> implement ModelProcessor.
>
> Thanks for hints
> Torsten
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>