[Java] []MAVEN]MVN eclipse:eclipse import jar failed, direct import project Problem solving method

Source: Internet
Author: User

When building a project using MVN eclipse:eclipse, reference a project that was written locally and found out how all references were unsuccessful

When you view the. classpath file, the referenced file appears in this form

[HTML]View Plaincopy
  1. <Classpathentry Kind="src" Path="/test.client"/>  

and look at the references to other jar packages like this

[HTML]View Plaincopy
  1. <Classpathentry Kind="var" Path="M2_repo/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar"/>  

kind is different.


Finally, it is necessary to set MAVEN Eclipse plugin as a parameter "useprojectreferences", which defaults to true. If the default value is used, then the project will introduce a local source code project or create a sub-project without introducing a jar package. Set to False, the project will reference the local warehouse's jar package.

See: Http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html#useProjectReferences


Finally, MAVEN's eclipse configuration is as follows:

[HTML]View Plaincopy
  1. < plugin >   
  2. <groupId>Org.apache.maven.plugins</groupId>  
  3. <Artifactid>Maven-eclipse-plugin</Artifactid>  
  4. <version>2.9</version>  
  5. < Configuration >   
  6. <useprojectreferences>false</useprojectreferences>  
  7.         </ configuration > &NBSP;&NBSP;
  8. </ plugin >   

[java][]maven]mvn eclipse:eclipse import jar failed, direct import project problem resolution

Related Article

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.