本文主要介绍如何搭建dcm4chee基于Eclipse平台的开发环境。
环境和工具如下:
OS: winxp sp3
JRE: 1.6.0_07 http://www.java.com/en/download/manual.jsp
jboss-4.2.3.GA http://transact.dl.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip
mysql v4.1+ http://dev.mysql.com/downloads/
Eclipse IDE for Java EE Developers http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-jee-galileo-SR1-win32.zip
Maven 2.0.9 http://archive.apache.org/dist/maven/binaries/apache-maven-2.0.9-bin.zip
XDoclet v1.2.3 http://transact.dl.sourceforge.net/project/xdoclet/xdoclet/1.2.3/xdoclet-bin-1.2.3.zip
apache-FOP 0.20.5 http://archive.apache.org/dist/xmlgraphics/fop/binaries/fop-0.20.5-bin.zip
dcm4chee 2.14.7的源代码: http://transact.dl.sourceforge.net/project/dcm4che/dcm4chee/2.14.7/dcm4chee-2.14.7-src.zip
dcm4che 1.4.26 http://transact.dl.sourceforge.net/project/dcm4che/dcm4che14/1.4.26/dcm4che-1.4.26.zip (注:dcm4che是DICOM库,dcm4chee引用了该库)
dcm4chee-docstore http://transact.dl.sourceforge.net/project/dcm4che/dcm4chee-xds/1.0.0/dcm4chee-docstore-1.0.0-src.zip
dcm4chee-xds http://transact.dl.sourceforge.net/project/dcm4che/dcm4chee-xds/1.0.0/dcm4chee-xds-1.0.0-src.zip
dcm4chee-audit http://downloads.sourceforge.net/project/dcm4che/dcm4chee/2.14.7/dcm4chee-audit-2.14.7-src.zip
安装开发环境步骤
(1) 确保上述环境和工具已安装到本地目录,环境变量PATH加入maven的bin目录
(2)导入源代码
1.打开Eclipse IDE
2.File->Import->Existing Projects into Workspace
3.Select root directory,选择dcm4chee源代码根目录,Finish
(3)修改编译环境参数
1.在dcm4chee源码根目录,有build.properties.default文件,更名为build.properties文件
2.将build.properties文件的以下属性设为正确的路径值,即安装的本地路径 (注:路径斜杠用/,不用/)
(dcm4che14.home,xdoclet.home,jboss.home,fop.home)
(4) build如下软件包,这些软件包都被dcm4chee所引用
(dcm4chee-docstore,dcm4chee-xds,dcm4chee-audit)
build工具为mvn,build方式如下
1.命令行进入到软件包源码目录
2.输入mvn install, 默认会在C:/Documents and Settings/[计算机名]/.m2/repository/dcm4che生成jar包
(5) 用ANT编译dcm4chee项目
1.在Eclipse展开dcm4jboss-build项目
2.选中build.xml,右键Run as->Ant build
编译后会显示build successful的提示,所生成的二进制包位于[dcm4chee源码根目录]/dcm4jboss-build/target目录下,
文件名类似于dcm4chee-xxx-2.14.7.zip,xxx是对应不同的数据库的版本。
参考文章:
http://www.dcm4che.org/confluence/display/ee2/Building+dcm4chee