這幾天被這個(gè)問題快折騰死了线衫,新寫的類方法明明有就是說找不到骗炉。最終定位到問題原因:在run項(xiàng)目時(shí)如果你是組合項(xiàng)目亏推。也就是有兩個(gè)或者多個(gè)project之間相互依賴。運(yùn)行時(shí)需要勾選“resolve workspace artifacts”這個(gè)選項(xiàng)河哑。作用是
Assume you have two or more projects in your workspace e.g.project1,project2and so on. Ifproject1is dependent onproject2andproject3, you just need to define the dependency ofproject1onproject2andproject3.
By enablingResolve Workspace Artifacts,m2Eclipsewill auto-build theSNAPSHOT JARofproject2andproject3and add in the classpath ofproject1.
In other words, it resolves the dependencies with workspace projects.
以上是引用stackoverflow
大概意思就是多項(xiàng)目互相依賴需要一起打包編譯,所以勾選“resolve workspace artifacts”
配置截圖: