jenkinsci / report-jtreg-plugin

Jenkins plugin to show JCK reports
https://plugins.jenkins.io/report-jtreg/
MIT License
1 stars 13 forks source link

Packaging the lib classes in the plugin jar/hpi #6

Closed patrikcerbak closed 10 months ago

patrikcerbak commented 10 months ago

Copied explanation from the script.sh file:

# Why is this here?
# After refactoring the codebase of this plugin into multiple modules, the report-jtreg-lib remained as a dependency
# to the report-jtreg-plugin module (the Jenkins plugin itself). However, because of the Jenkins security hardening
# (https://www.jenkins.io/blog/2018/03/15/jep-200-lts/), the plugin can't load classes from external modules and it
# throws an class filter exception. After trying many different solutions to the problem, this seemed like the only
# doable workaround.
#
# What does this do?
# This script is run in the compile phase of the report-jtreg-plugin module (the report-jtreg-lib module is already
# compiled) and it copies the target folder of the lib module to the target folder of the plugin module. Since the
# report-jtreg-lib dependency has the "provided" scope, the classes do not clash and the plugin works as intended with
# the lib classes in the plugin jar/hpi.

The compiling works only on Linux for now, but I will add Windows support very soon.

judovana commented 10 months ago

Sounds great! Ty!

judovana commented 10 months ago

Actually one more thought - readmme.md. Youa r ento removing the workaround, which you should, however - not remeve, but rework. How does it work form ide? As yo can launch jenkins as development target. Does it work without magical switches? How other non-standart tasks? Like hpi:run? how debugger? Does it connect correctly? Can it happen, that developemnt version will eb different then deplyed version (without develoepr knowing)?

patrikcerbak commented 10 months ago

It should now work on Windows, however the maven command only works with -DskipTests=true. There is problem in a comparator test (only on windows, not linux) - newline at the end of an output...

I will look at it later.

judovana commented 10 months ago

Normally I would say its ok, but CI does ot say taht. TY!

judovana commented 10 months ago

We need to work o that reeadme thing. For hpi:run or IDE tasks it may remain crucial.