Maven does not add classpath to Eclipse project

前端 未结 7 2032
旧时难觅i
旧时难觅i 2020-12-15 03:37

I have a maven project, that I\'m working on Eclipse.

I use maven eclipse:eclipse to generate the classpath, but ... it NEVER adds the classpath on the eclipse proj

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 04:24

    In addition to the most voted answer, you can still be left with a broken project, no 'Maven Dependencies' (Kepler) and no classpath resolution.

    In my case my local maven repository settings.xml got deleted when a third party sdk updated itself, after a restart eclipse seemed to clear out the reference to that settings.xml file.

    Once I put the file back and referred to it in Maven > Installations > Global Settings: /home/andy/.m2/settings.xml , cleaning each project kick-started all the necessary classpath resolution. just sharing.

    For me, the resulting files looked like:

    .classpath

    
    
        
        
        
        
    
    

    .project

    
    
        jemh-ao
        
        
        
        
            
                org.eclipse.jdt.core.javabuilder
                
                
            
            
                org.eclipse.m2e.core.maven2Builder
                
                
            
        
        
            org.eclipse.jdt.core.javanature
            org.eclipse.m2e.core.maven2Nature
        
    
    

提交回复
热议问题