Enhancement: Add bundle config property that allows custom libs to be available at server boot time / FISH-6305 #47
Labels
Status: Accepted
Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Type: Enhancement
Label issue as an enhancement request
Description
Hello friends,
With this issue I am requesting for a new configuration property to be added to the Payara Micro Maven Plugin, more specifically to the bundle goal.
The purpose of this proposed config property would be to define one or more jars that would be added to
MICRO-INF/runtime
directory within the generated bundle (or any other directory that would allow the bootstrap main class to have access to these immediatly at boot time).The reasons for this are:
MICRO-INF/lib
in the case of customJars orMICRO-INF/deploy
in the case of deployArtifacts. And both these directories do not make these jars available as soon as the server starts which makes their usage, for this end, impossible--outputlauncher
option on the bundle (it will copy the custom jars from/lib
to/runtime
an so they will be available at boot time), which is not a practical solution at all. In this Uber Jar world it is preferable to have it all packaged and then justjava -jar
on itclasspathArtifactItems
that performs something similar. However, it is not exactly the same thing because it won't package the lib into the uber jar, so one always needs to have access to maven (and then to the source repository) to fetch the dependencies at boot time (not exactly what you would want in a docker image, for example). Also if that jar we want has dependencies they must all be included even if they are already provided by the server. (Also, this property is not documented on the docs, I just found it digging through the repo)Expected Outcome
A new configuration property to be defined on the bundle goal, like
<runtimeLibs>
or other name, which would allow for the definition of GAV coordinates that would include any jars declared into theMICRO-INF/runtime
folder (or any other folder that can be added to classpath at boot) on the final microbundle generated.Alteranatively, a flag property on
customJar
like<addToClasspath>
which would add the declared jar toMICRO-INF/runtime
, instead ofMICRO-INF/lib
, again included in the final microbundle.Current Outcome
customJars
will include jars toMICRO-INF/lib
which is not accessible at boot time, so these jars are not available for, let's say, logging initialisation.--outputlauncher
on the generated bundle.Context
The main reason that drove to this enhancement proposal arose from this isse I have created here #5708 but also from another one #4546 with a similar problem.
I believe that this a much needed feature because logging frequently needs to be tweaked for several purposes, namely using custom formats to convey to any cloud standard (think logging to stdout instead of the default stderr, for exemple).
While I would argue that logging features would greatly benefit from being expanded on Payara as a whole, this solution would be a very good workaround because it would allow for JUL extensions to be developed and deployed on Payara with relative ease.
Also, despite this being specific for Maven plugin I would imagine that the folks that use Gradle could also benefit from it.
Thanks
Ecosystem Tool
The text was updated successfully, but these errors were encountered: