導入包報錯The import org.springframework cannot be resolved


剛開始學spring框架時import org.springframework.context.support.ClassPathXmlApplicationContext;報錯

我建的是maven項目,上網查了一下,在pom.xml文件加上下面代碼即可

   <dependencies>
     <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-context</artifactId>
         <version>4.3.17.RELEASE</version>
     </dependency>
   </dependencies>

注意,要放在<bulid>外面,添加后右鍵項目->Maven->Update Project就完成。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM