today, using MAVEN to create a multi-module project, after creating the parent project and the individual submodules, when compiling the parent project, there is a bunch of red forks on the parent project catalog, and it is not possible to find a dependent class, but the dependence of the corresponding jar in the Pom file is written , there are jar packages in the local Maven repository, but there is no Maven Dependencies in Eclipse's library , which is really scratching your heads .
Online Search, most of which is the following approach:
Right-click Maven Project--Macven--Enable Dependency Management
but it seems to me that this is not the right way. Then I looked at the other items, and then we opened the. classpath file for two items compared to the next, sure enough there are different, problematic items for the. classpath file is not "org.eclipse.m2e.MAVEN2_ Classpath_container"This part of the. Copy this line into the problematic project and reload the project, OK.
<?xml version= "1.0" encoding= "UTF-8"?>
<classpath>
<classpathentry kind= "src" output= "target/classes" path= "Src/main/java"/>
<classpathentry excluding= "* *" kind= "src" output= "target/classes" path= "Src/main/resources"/>
<classpathentry kind= "Con" path= "org.eclipse.jdt.launching.jre_container/ Org.eclipse.jdt.internal.debug.ui.launcher.standardvmtype/jdk1.7.0_45 "/>
<classpathentry kind= "Con" path= "Org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind= "Output" path= "Target/classes"/>
</classpath>
Blog is to remember that they are easy to forget things, but also a summary of their work, the article can be reproduced, without copyright. Hope to do their own efforts to do better, we work together to improve!
If there is any problem, welcome to discuss together, code if there is a problem, you are welcome to the great God!
Maven project does not have maven Dependencies in the Eclipse Library