plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Feinauer <>
Subject Fat-Artefacts and multiple Drivers
Date Sun, 21 Apr 2019 12:24:40 GMT
Hi all,

I just stumbled upon something, I think I observed before, but wanted to bring it back to
the list (again).
First off, I’m unsure if it’s a bug or a feature so lets discuss this (and if it’s a
feature, here is an explanation how to deal with it gracefully).

For my interop server (see PLC4X-111) I built a server which other languages can run in the
background to issue queries against.
Thus, a “fat-jar” was necessary (which I created using the assembly plugin).
And after that, I observed that I can only use ONE driver, all others do “not work”.

This is, due to the fact, that our service files (under META-INF/service) are overwritten,
with the default configuration as they are copied together.
If one uses the maven assembly plugin this can be solved as there are container descriptor
handlers [1] which copy all lines from all these files together.
But, if using these, one needs to create a separate assembly descriptor.
Mine is

<assembly xmlns=""
  <!-- TODO: a jarjar format would be better -->

This is basically the default “jar-with-dependencies” plus the container descriptor handler
for the meta-inf/services files.
This xml should be placed unter src/assembly (states the docu).

Then, the pom has to adapted in the following way:

          <!-- get all project dependencies -->
<!--          <descriptorRefs>-->
<!--            <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!--            <descriptorRef>metaInf-services</descriptorRef>-->
<!--          </descriptorRefs>-->
          <!-- MainClass in mainfest make a executable jar -->

            <!-- bind to the packaging phase -->


The finally packed “fat-jar” works then flawlessly and with multiple implementations of
the same Service.

Is this the way we agree to go?
Is my setting correct?


PS.: This code (above) can be found in my implementation for PLC4X-111 the interop server,
see [2].

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message