Home > Java > body text

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

WBOY
Release: 2024-02-08 21:00:16
forward
1202 people have browsed it
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]
Copy after login

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!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template