walokra / markdown-page-generator-plugin

Markdown to HTML Page Generator Maven Plugin
MIT License
56 stars 48 forks source link

Support threadSafe use for multi-module projects #61

Closed jodygarnett closed 3 years ago

jodygarnett commented 3 years ago

I quite enjoy this plugin and reviewing the codebase I believe it can be made threadSafe and compatible with multi-module projects.

Presently building a multi-module project, with -T2C or similar, produces the following warning:

[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that have goals not marked   *
[WARNING] * as @threadSafe to support parallel building.                  *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in GeoServer Enterprise 2021.1 Data:
[WARNING] com.ruleoftech:markdown-page-generator-plugin:2.3.0
[WARNING] Enable debug to see more precisely which goals are not marked @threadSafe.
[WARNING] *****************************************************************

There are some requirements to writing a thread-safe plugin, mostly per-lookup instantiation so each use of the plugin is a new object and avoiding the use of static fields to share state across threads.

jodygarnett commented 3 years ago

Thanks for accepting the PR, I look forward to the next release.

walokra commented 3 years ago

This issue is now released with https://github.com/walokra/markdown-page-generator-plugin/releases/tag/2.3.1