Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin

后端 未结 12 1324
感情败类
感情败类 2021-02-04 06:49

I got a maven spring project but when I try to run it, I can\'t... some idea about it...
The next is the Error Message:

BUILD FAILURE
-----------------------         


        
相关标签:
12条回答
  • 2021-02-04 07:19

    I had this problem because Java (java) was version 8 and the Java compiler (javac) was version 11.

    This is typical for Windows users, if you need to switch between versions manually.

    Please check the versions first:

    java -version
    javac -version
    

    If an IDE is used, for example an IntelliJ Idea, then I will advise to carefully study the project settings as well. Perhaps it makes sense to completely delete the files generated by the IDE and import the project again.

    0 讨论(0)
  • 2021-02-04 07:21

    After doing some research found an answer for this .if your using IntelliJ

    Go to Settings ---> builds --> Maven -->set the Maven home directory.

    0 讨论(0)
  • 2021-02-04 07:21

    I faced this issue. Its because of the maven binary version used.

    I have used maven 3.0.3 version. and the enforcer plugin wasn't reliable with that. So changed the maven binary to latest 3.6.3. And the issue got resolved and working awesome.

    0 讨论(0)
  • 2021-02-04 07:24

    It is possible that someone is enforcing a specific Maven version.

    If you see the following message:

    [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message: Detected Maven Version: 3.5.4 is not in the allowed range [3.5.2,3.5.2].

    Then change your maven installation to the something in the specified range. In this example, only version 3.5.2 is allowed.

    0 讨论(0)
  • 2021-02-04 07:24

    Check your maven version, for example, if you are installing Apache-CXF 3.6 and your maven version is 3.0.5, then you get errors. If you're installing Apache-CXF 3.6, the minimun version of maven must be 3.1, and the minimun version of Java must be 8.

    0 讨论(0)
  • 2021-02-04 07:27

    Firslty go tto project and run mvn clean , if build is success then just check whether the required dependency is downloaded in your .m2 folder or not , If dependency does not get downloaded in your local .m2 folder , it means either version number is incorrect for that dependency or artifactory path is not correct

    Else if mvn clean itself fails while dependency exist in your .m2 folder , means yoru settings.xml file actually got corrupted

    0 讨论(0)
提交回复
热议问题