-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support late property resolution to allow easy jacoco agent integration #1705
Comments
@bmarwell So would the |
Yup, here's the exact location: Now, before working on this: Is adding the jacoco agent even possible on Liberty? Has anyone ever tried that? |
No idea :-) |
A quick search found this https://stackoverflow.com/questions/30740082/using-jacoco-with-liberty-profile-8-5-5-4-in-eclipse-does-not-produce-any-code-c but I'm not sure who's tried it more recently. That at least suggests there is some version of JaCoCo that once provided some value, working with some version of Liberty, but that's fairly old information and I don't know any more at this point either. Can I ask too, for this use case, are we assuming that (assuming we added support for this resolution) you'd still need to run to actually run the jacoco plugin before the liberty plugin, during the same build? So for Liberty dev mode, you might have to run? :
|
Hey, I will also ty to add the agent |
@bmarwell Question: Do we only need to resolve the @{xxx} properties that are referenced in Maven properties? Or do we also need to handle them in the configuration parameters for the plugin (such as the Also, I presume we do not need to look for and resolve these types of references within config files specified by other parameters such as |
Huh. Good questions.
I am pretty sure it would be confusing if they were NOT equivalent. So, I'd say yes: both the properties and jvmOptions parameter should support this. I.e. late resolution.
I think this is not needed. So far and as I know, late resolution is only implemented in maven's pom.xml itself (e.g. for the plugins surefire, jacoco, etc.). |
The |
@cherylking I forgot to say thanks -- works like a charm. Here is an example how I use it:
This is especially useful when building on shared systems, i.e. without docker support. |
Dear Liberty-Maven-Plugin-Team!
Currently, the liberty-maven-plugin does not support the "very special" late property resolution.
With late property resolution, property can be defined as
@{property}
instead of${property}
.Surefire and failsafe make use of them.
What is the use case?
Some plugins, for example jacoco, define the variables later in the build lifecycle. Jacoco will define (by default) a variable called
<argLine>-javaagent:/path/to/.m2/org/jacoco/jacoco-agent-lib.jar</argLine>
.However, as
${}
variables are resolved by maven before jacoco will be executed, Suerfire/Liberty would just see an empty variable (at best) or the maven build will fail due to an unset variable.For this reason,
@{}
variables were introduced with late resolution.This way we could define something like this:
Currently, Liberty will write just a plain
@{argLine}
into the filejvm.options
. Instead I would like to see the-javaagent:
line.Please implement
@{}
variables so we can easily integrate the jacoco agent.Hint: Googling for
"liberty-maven-plugin" "jacoco"
does not yield any results.The text was updated successfully, but these errors were encountered: