Maven project lacks MAVEN dependencies solution summary

Source: Internet
Author: User

First, a MAVEN project was built today, and after the introduction of dependencies in the Pom.xml file, it was found that there was no Maven dependencies file in the project structure (below), but Maven was found in the Java Build path Dependencies file (pictured below),

However, the dependency jar package added in the Pom.xml file is not automatically downloaded to the project, and the update project is the same, so the online search for a lot of methods, after trying to find no use, finally, to view their pom.xml files, found to be in the reliance on the previous written < Dependencymanagement> this label (below), after checking the data, found that the role of this tag is only to declare dependencies, do not implement the introduction of dependency, therefore, without the introduction of the jar package, MAVEN project will not show Maven dependencies files. After removing this tag, the problem is resolved and the Maven dependencies file appears in the MAVEN project.


Ii. Other ways to resolve the missing Maven dependencies file on the Web:

The 1th type: MAVEN support is not turned on: this is usually the case with Eclipse's own maven, or the self-installed MAVEN does not open the service.

Workaround: Right-click Maven Project-->maven-->enable Dependency Management

(There may be some MAVEN versions that do not have the Enable Dependency management option)

2nd type:classpath file problem or. project file issue:

Workaround:

(1) Add the following code to the. classpath file

<classpathentry kind= "Con" path= "Org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" >
		<attributes>
			<attribute name= "maven.pomderived" value= "true"/>
			<attribute name= " Org.eclipse.jst.component.dependency "value="/web-inf/lib "/>
		</attributes>
	</classpathentry >
(2) Add the Red Font section to the <natures> of the. Project file:

	<natures>
		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
		<nature> Org.eclipse.wst.common.modulecore.modulecorenature</nature>
		<nature> Org.eclipse.jdt.core.javanature</nature>
		<nature>org.eclipse.m2e.core.maven2nature</nature >
		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
		<nature> Org.eclipse.wst.jsdt.core.jsnature</nature>
	</natures>
The 3rd type:Project-->properties-->deployment Assembly-->add-->java build path Entries-->maven Dependencies--Finish

4th: Project is non-MAVEN project (less case)

Workaround: Right-click Project-->configure-->convert to Maven project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.