在使用 mvn eclipse:eclipse 命令生成適合eclipse的java項(xiàng)目后,使用import將項(xiàng)目導(dǎo)入進(jìn)eclipse。
這時(shí)候類庫(kù)會(huì)報(bào)錯(cuò): Unbound classpath variable: 'M2_REPO/**/***/***.jar'
這是因?yàn)閑clipse里面還沒配置對(duì)應(yīng)的classpath variable。
配置方法如下:
Eclipse->Windows->Preferences->java->Build Path->Classpath Variable->New
名字:M2_REPO,屬性選folder,指向C:\Documents and Settings\your name\.m2\repository