在使用 mvn eclipse:eclipse 命令生成適合eclipse的java項目后,使用import將項目導入進eclipse。
這時候類庫會報錯: Unbound classpath variable: 'M2_REPO/**/***/***.jar'
這是因為eclipse里面還沒配置對應的classpath variable。
配置方法如下:
Eclipse->Windows->Preferences->java->Build Path->Classpath Variable->New
名字:M2_REPO,屬性選folder,指向C:\Documents and Settings\your name\.m2\repository