Home  >  Article  >  When I run "mvn install" of the module I get the error

When I run "mvn install" of the module I get the error

WBOY
WBOYforward
2024-02-08 21:00:161118browse
Question content

My project is based on maven. I am about to run a sub-project in the cluster project, but when I try to package my project (mvn package), the idea compiler reports an error:

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.4.2:check (spotless-check) on project flink-udf-robot: Execution spotless-check of goal com.diffplug.spotless:spotless-maven-plugin:2.4.2:check failed: java.lang.reflect.InvocationTargetException: class com.google.googlejavaformat.java.RemoveUnusedImports (in unnamed module @0x42507640) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x42507640 -> [Help 1]

It seems that this problem is related to jdk, but I don’t know what to do specifically. I'm new to programming and don't know much about environmental issues.

I encountered this problem while performing the mvn clean->mvn install step. The compiler used in my project is javac.


Correct answer


Check Maven version: You can check the Maven version by running mvn -version. If needed, update Maven to the latest stable version.

Check dependencies: Verify the

specified in your dependencies

The file is correct and accessible. If dependencies are not found or there are version conflicts, this may cause the build to fail.

Cleaning items: Run mvn clean install. This will clean the target directory and then run the installation phase. Sometimes, previously built artifacts can cause problems. Run in debug mode: You can run Maven in debug mode to get more details about the build process. Use mvn install -X to enable debug output.

The above is the detailed content of When I run "mvn install" of the module I get the error. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete