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
Make Checkstyle an (automatic) module #14120
Comments
Please share details. We use maven for long time, never had a problem.
I thought all maven artifacts are named like this, org name is in path/folders of maven repository. Please share details/examples that some other old projects are migrating.
Did you miss version and extension? Please share link to your project with extension of checkstyle What benefits our project will have from this? We have two plugins in our org ( sonar and eclipses), how it will help them? Is it somehow breaking compatibility issue for some users? To let us plan it accordingly. |
It is not about Maven, it is about the Java 9 module system. This is the
Java Compiler (since Java 9): Maven: Please check this for more background: https://dzone.com/articles/automatic-module-name-calling-all-java-library-maintainers |
I am not sure I can find time to investigate all of this. |
Sure, I can try. For the beginning, the simplest way would be to make Checkstyle a named automatic module. All you need to do is, add this line to your
This should change nothing in the behavior when used in a non-modularized environment. However, when used in a modularized environment, all those warnings should disappear. Depending on your project setup this can be done manually or as a configuration in the packaging in the The next step would be to create a proper This will be my first contribution to an open source project. So please be patient with me. Best regards, |
I did my very best. Hope this will help you. #14139 |
Co-authored-by: rnveach <rveach02@gmail.com>
@future2r When working on the backport release ( rnveach/checkstyle-backport-jre8#13 ), I received the following error:
When I run Do you happen to know why this is? Is this because this project is for Java 8 only and this automatic module is more Java 9+? Edit: I see now. It is because the artifact name has |
Checkstyle 10.x requires JDK 11 to run. Wouldn't it be the right time to finally make it a Java module (introduced with JDK 9)?
I have implemented some Checks for Checkstyle by my own. My project complains about an 'unstable module name derived from the file name'. Even Maven warns about not uploading my project to a public repository, since the build is far from being stable.
Since the filename is something like
checkstyle-10.12.6.jar
, Java ends up with the module namecheckstyle
. Usually, a good naming would be the name of the main package, in this casecom.puppycrawl.tools.checkstyle
. This is more expressive and more unique.You may achieve this just by adding a
module-info.java
into your source root. For the beginning you may export all your packages and open those, that require reflection.If this is not an option, please add
AutomaticModuleName
to theMANIFEST.MF
. In this case, at least the module name is no longer constructed from the file name.https://dzone.com/articles/automatic-module-name-calling-all-java-library-maintainers
jlink requires module-info.java, see details at #14666
The text was updated successfully, but these errors were encountered: