springdoc / springdoc-openapi-maven-plugin

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
141 stars 37 forks source link

The following plugins are not marked @threadSafe org.springdoc:springdoc-openapi-maven-plugin:1.1 #21

Closed patpatpat123 closed 3 years ago

patpatpat123 commented 3 years ago

Hello Team,

We have a maven multi module, where all child modules are independent business modules. (They could have been separated entirely into multiple standalone projects, but for organizational project, we created one multi module project, with multiple independent children modules inside, anyway, the point is not here).

Since they are independent, and we have some 30 of them, instead of building, running test, generating the openAPI V3 document one project after another (which is very time consuming and waste of computation) we decided to run the pipeline in parallel, with something like:

mvn -T 8C clean install -U -Pintegration -Dspringdoc.writer-with-default-pretty-printer=true javadoc:javadoc checkstyle:checkstyle spotbugs:spotbugs pmd:pmd pmd:cpd org.pitest:pitest-maven:mutationCoverage jacoco:prepare-agent jacoco:report dependency:tree sonar:sonar

We are facing this message when we are doing so:

The following plugins are not marked @threadSafe in myproject:
org.springdoc:springdoc-openapi-maven-plugin:1.1
Enable debug to see more precisely which goals are not marked @threadSafe.
*****************************************************************

Just to confirm if we do not run openAPI V3, we have the parallelism fine. So, I just wanted to report the issue (or ask for the request for enhancement) to make this plugin thread safe for parallelism documentation generation in the even of maven multi module projects.

Thank you

bnasslahsen commented 3 years ago

@patpatpat123,

maybe you can submit a PR, for this enhancement?

patpatpat123 commented 3 years ago

Definitely interested to contribute to this cool project.

However, I am doubtful of my coding skill to properly solve this.

As you can see, I am more of a happy user, that knows how to import a dependency and run a maven command.

Maybe if you can point me to the right direction, that will be helpful.

Something like "in order to resolve this, annotate those methods with an annotation".

"In order to resolve this, add this dependency"

"In order to resolve this, change the implementation of this class A by using a thread pool executor"

Some pointers like those would be helpful otherwise, my understanding of tis project is really just as a happy user.

Thank you!

bnasslahsen commented 3 years ago

@patpatpat123,

You have the contribution guide, where all the steps are explained. And simply provide your PR to this repo.

patpatpat123 commented 3 years ago

I know about the contribution guide and what is a PR.

What I was trying to say is that I have no idea what to put IN the pull request to fix this 😛

Sorry, I am not that good with java, just a happy user

bnasslahsen commented 3 years ago

ok i see ... We will close this enhancement request, as it doesn't seem to be a top priority for the project.

patpatpat123 commented 3 years ago

Actually, it is more of a bug fix request, building docs in parallel should be thread safe, I haven't read any documentation stating this plugin only generate docs one by one.

bnasslahsen commented 3 years ago

You have a workaround, by simply not running your jobs in parallel! We do not consider it a top priority request.

patpatpat123 commented 3 years ago

I understand it is not a priority, but that does not mean it is not a valid bug. And I would say, maybe you closed a valid bug

I am reading again the docs, while it is not written "this plugin supports building documentation in parallel" there is also no mention of "not running your jobs in parallel!"

It might be looking like a hidden basic java multi threading bug instead

patpatpat123 commented 3 years ago

Just trying to contribute by finding valid bugs, even if they are very low priority and meaningless :)

I guess that is the only thing a novice Java programmer can do

bnasslahsen commented 3 years ago

@patpatpat123,

This is not a bug, as you see no where in the documentation of the plugin, that it supports running jobs in parallel.

You could just submit your enhancement request which might have been more useful to the community. You can see that it doesn't require a lot!

Anyway, i did the change. You can test it using the last SNAPSHOT, once available in maven central.

patpatpat123 commented 3 years ago

To be honest, my Java level is not good enough to understand the commit you made shame on me!

But indeed, what I can do is to test with the new version as soon as it is ready

patpatpat123 commented 3 years ago

May I ask if this is ready please?

patpatpat123 commented 3 years ago

Will be glad to test, but not finding anything on Maven

bnasslahsen commented 3 years ago

@patpatpat123,

You could test with the latest snapshot. Anyway, you have now also v1.2 of the plugin that is deployed in maven central.

patpatpat123 commented 3 years ago

And working now. thanks