Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 437 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin

#11
You should probably check if you have two different versions of same artifact somewhere. I faced it when I wanted to add new maven dependency while I already added it on a different dependent project with different versions.
Reply

#12
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.
Reply

#13
This error is likely caused due to a mismatch of the java version specified in the pom file and the java in your system. I had Java 16 installed in my system but the pom pointed to java version 8.

There are 2 ways to solve this:
1. Update the java version in the pom file to the java version installed on your PC, but this will likely cause a lot of dependency issues.
2. Uninstall java installed in your system, and reinstall the java version specified in the pom file. You can do this by following the steps mentioned below:

Check the java version in your system with the following command:

java -version
And then check the java version defined in your pom file. It'd be something like

<project.java.version>1.8</project.java.version>

Install JDK 8.
Reply

#14
You should solve the root cause of the issue, conflict between some of your dependecies, mvn/java version, there is a lot of possible reasons.

You might run `mvn dependency:tree` and check in the list if there is maybe 2 different versions or implementations of the same library from different package. Often you will have a parent pom or a dependency somewhere in the framework uncompatible with one that you added into your pom.

But often, despite this enforcer error your project could build and run perfectly so this is a workaround to build ignoring the error

To skip enforcer (not always working)

mvn clean install -Denforcer.skip=true

To continue the build if error

mvn clean install -Denforcer.fail=false

There is probably some ways to exclude a specific library from the enforcer rules too which is probably better that juste skipping everything.
Reply

#15
In my case, apparently there was a configuration conflict that generated this error. So when I **temporarily** deleted the ***[/home/myuser/.m2/settings.xml][1]*** file, the per-line maven execution was successful.

Note: In my scenario, I had Eclipse with the maven plugin and I was trying to use maven by command line and then this error message appeared.


[1]: https://
Reply

#16
I initially checked the java version with the following command
***java -version***
As it is was not on the required java version,I changed the java version by using following command
***sudo update-alternatives --config java***
This command gave me options to choose the required java version.
After proper selection of java I could perform the following command
***mvn clean install -DskipTests***
and the build was successful.Hence solved this issue
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through