背景 工作中要實(shí)現(xiàn)跨數(shù)據(jù)庫(kù)的package調(diào)用,在jsp前端返回,目前項(xiàng)目上只是Maven,所以參照Andyの筆記來(lái)看看結(jié)合自己所在項(xiàng)目都需要哪些更新來(lái)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的功能。 1、Maven 雖然項(xiàng)目中已經(jīng)在Eclipse中嵌入了Maven,但還是可以單獨(dú)安裝一個(gè)Maven的工具在系統(tǒng)
工作中要實(shí)現(xiàn)跨數(shù)據(jù)庫(kù)的package調(diào)用,在jsp前端返回,目前項(xiàng)目上只是Maven,所以參照Andyの筆記來(lái)看看結(jié)合自己所在項(xiàng)目都需要哪些更新來(lái)實(shí)現(xiàn)一個(gè)簡(jiǎn)單的功能。
雖然項(xiàng)目中已經(jīng)在Eclipse中嵌入了Maven,但還是可以單獨(dú)安裝一個(gè)Maven的工具在系統(tǒng)中,參考Andy的Maven環(huán)境搭建和介紹 來(lái)操作即可。
中間遇到了問題“-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.”,可以在這里解決。
加載完dependence之后,按Andy的Mybatis使用generator自動(dòng)生成映射配置文件信息交待生成配置文件。其中正確生成了BxxxxxLxxxx.java,BxxxxxLxxxxMapper.java 以及BxxxxxLxxxxMapper.xml,分別放在\src\main\java\com\xxxxx\xxx\domain,src\main\java\com\xxxxx\xxx\mapper以及src\main\java\com\xxxxx\xxx\mapper\sqlmaps目錄下。
按照步驟提示繼續(xù),針對(duì)即將新引入的jar包,更改pom.xml文件
org.springframework spring-core3.1.1.RELEASE org.springframework spring-beans3.1.1.RELEASE org.springframework spring-context3.1.1.RELEASE org.springframework spring-tx3.1.1.RELEASE org.springframework spring-web3.1.1.RELEASE org.springframework spring-webmvc3.1.1.RELEASE org.springframework spring-jdbc3.1.1.RELEASE org.springframework spring-test3.1.1.RELEASE test org.mybatis mybatis3.1.0 org.mybatis mybatis-spring1.1.1 log4j log4j1.2.17 org.apache.struts struts2-core2.3.16.3 org.apache.struts struts2-json-plugin2.3.16.3 org.apache.struts struts2-spring-plugin2.3.16.3 com.google.code.gson gson2.1 com.mchange c3p00.9.5 org.aspectj aspectjweaver1.6.8 ... cglib cglib2.2.2 src/main/resource *.xml *.properties
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com