I am using retire.js plugin in maven pom file. The vulnerability details are listed along with the build output.
I would like to extract the retire.js output into a separate file.
Can you please suggest some ways to extract only retire.js data into a file.
Looking into the source code of retire.js Maven plugin we can notice that the log output from retirejs is redirected into Maven's stream (in
initMiniLog()
). And there seem to be no specific configuration for it.However, with a bit of tweaking we can set up Maven to gather these logs. So I can suggest the following:
1) By default Maven uses slf4j-simple logger, remove its jar from
{M2_HOME}/lib
.2) Place in the same folder a logging library that supports output into files, for example Logback:
logback-classic-*.jar
andlogback-core-*.jar
.3) Define a configuration that will output everything into stdout and only the things that you are looking for into the file.
logback.xml
should be placed into{M2_HOME}/conf/logging
. For example, I used the following draft configuration to extract the output of maven-compiler-plugin into maven.log in the current folder:4) Execute your build command...