I have a Maven error like the following in Eclipse for a Maven project.:
Project 'project1' is missing required library: '.../.m2/repository/.../project2/0.37.0-SNAPSHOT/project2-0.37.0-SNAPSHOT.jar'
The project cannot be built until build path errors are resolved
The error is wrong, because in the parent pom.xml version 0.38.0-SNAPSHOT is defined, which also lies in the .m2 repository as project2-0.38.0-SNAPSHOT.jar
I tried: "Right click" -> "Maven" -> "Update Project...", but it does now solve the problem.
Then I tried: mvn eclipse:clean eclipse:eclipse, which solved the problem. But, then the problem is, that it converts the Eclipse Maven project to an Eclipse project. So I have to manually convert it back to an Eclipse Maven project. I also wonder because Apache Maven Eclipse Plugin is RETIRED.
Is there another solution to the above Problem?
Your error messages sais something about 0.37.0-SNAPSHOT but in your text you refere to 0.38.0-SNAPSHOT. Is it a mistake or maybe the version in your dependency is wrong?
First your are right not to mix mvn eclipse:eclipse and eclipse-m2e plug-in. Second the Maven->Update Project should fix any misconfiguration.
I would suggest to call mvn clean install in your console to verify that there are no real dependency problems. Eclipse sometimes does not update its index correctly.
Second if the error still appears try to restart your eclipse. I often saw that eclipse-m2e does cache some stra
I was working with a Java project in the IntelliJ platform and started over after reinstalling the Mac OS again. The project structure looks slightly weird now with BitCoinWalletApp[1] and BitCoinWalletApp[2],
When I run with the Tomcat 8, I get the following error,
Error:Cannot build artifact 'BitcoinWalletApp (2):war exploded' because it is included into a circular dependency (artifact 'BitcoinWalletApp (2):war exploded', artifact 'BitcoinWalletApp (1):war exploded')
Whats the issue here and how to solve it?
turns out this happened because the project has more than one pom.xml file which intelliJ detected as another source of valid pom.xml, in this case its pom.xml.back, to fix it, delete the backup version of your pom.xml
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
------------------------------------------------------------------------
Total time: 4.532s
Finished at: Wed Jul 26 16:04:06 COT 2017
Final Memory: 17M/196M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce
(enforce-versions) on project SIMI: Some Enforcer rules have failed. Look above for
specific messages explaining why the rule failed. -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
one thing that may cause this problem is that in your project in a POM file required java or maven version is set. you should find it... but how ?
maybe you couldn't find any enforcer in your project like me ...
(I had the same problem and I became confused because enforcer plugin was not defined in my projects POMs, so I couldn't find it).
enforcer plugin is in your "effective pom" and you should check it.
Effective pom is a configuration file made from super pom + project pom.
maven use this configuration file to execute the relevant goal. It helps developers to specify minimum configuration detail in his/her pom.xml. Although configurations can be overridden easily.
For showing your effective pom there are 2 ways:
1- use maven command, run this command :
mvn help:effective-pom
2- use your IDE : in Maven window right click on your project node and select show effective POM(it depends on your IDE).
after you find what your forces are you can find it in your project and change it.
for me, My effective POM had enforcer plugin which its requireMavenVersion rule for using Java was 1.8. so I changed my project JDK version to 1.8 and luckily the problem was solved.
I hope this answer could help you.
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.
If you are using version 1.4.1 of maven-enforcer-plugin and it is resulting in this error then you need to use an older version of maven-enforcer-plugin. You can find the Maven dependency below :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
</plugin>
Other versions can be found from the link below.
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-enforcer-plugin
Also, check your Maven version. If you are using maven 3.0.x then you need to use maven-enforcer-plugin 1.4.1.
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.
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:
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.
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.
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.
I faced the same issue and resolved it by fixing the pom versions. Below command didn't run properly on all the sub pom's which resulted in different pom versions.
'mvn versions:set -DnewVersion=${NEW_VERSION} versions:commit'
Check whether all the moms have same version if there is dependent pom's.
After doing some research found an answer for this .if your using IntelliJ
Go to Settings ---> builds --> Maven -->set the Maven home directory.
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.
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
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.
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.
In my case, apparently there was a configuration conflict that generated this error. So when I temporarily deleted the /home/myuser/.m2/settings.xml 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.
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
This worked for me.
mvn clean
mvn clean install
I am using Eclipse Luna with Maven 3.0.2, when i try to do mvn install through command prompt on my project , its working fine.
But when i run mvn install through eclipse , its failing with the below error
plugin - maven jar plugin or one of its dependencies could not be resolved ,
failed to read the maven-jar 2.4 artifact.
can not access the maven repository using the registered transporter factories
WagonTransportFactory: java.util.NoSuchElementException
Can anyone help on this if you have faced this before or having knowledge on this.
Thanks for your response...
I tried settings.xml and proxy , it didnt happen.
Then i tried with Kepler eclipse , its working fine now.
I think Luna has some issues.
I am following steps listed for Broadleaf 3.0 from the link.
Using the Eclipse-workspace with M2E plugin, I tried Maven Update Project and refresh.
However, the maven multi-module projects have unresolved build errors:
Description Resource Path Location Type
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /core line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /admin line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /core line 3 Maven Dependency Problem
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /site line 3 Maven Dependency Problem
Missing artifact org.eclipse.core:jobs:jar:3.3.1 pom.xml /site line 3 Maven Dependency Problem
Missing artifact org.eclipse.equinox:registry:jar:3.3.1 pom.xml /admin line 3 Maven Dependency Problem
I am using STS v3.2.0( I even tried with Eclipse Kepler version, same issue).
No build problems were present when using previous Broadleaf version 2.2.
I also searched maven repository for missing jars: here and here but errors are unresolved.
Is this still an issue for you? I see all three of those depdencies as available on Maven central as seen here:
registry
common
jobs
If you make sure that you're not using a mirror of Maven central that doesn't have those JARs available, it should pull down if you run mvn install -U
I employed a dirty and hacky workaround to fix Maven Build issues.
I had to manually download the closest version missing jars from maven repository, change versioning of jars in maven install command. For example:
The only available version for jar org.eclipse.equinox.common is v3.6.0.v20100503 present here:
Then install artifact with required version(v3.3.0) using maven command in following way:
mvn install:install-file -Dfile=~/Downloads/org.eclipse.equinox.common-3.6.0.v20100503.jar -DgroupId=org.eclipse.equinox -DartifactId=common -Dversion=3.3.0 -Dpackaging=jar
Please note you will have to download/install 5-6 jars in this manner.
I got the demo site and admin to work so far with no errors. Thus, the jar version mismatch hasn't impacted the Broadleaf Demo, atleast for now.