Xml 使用Ant在Jar中包含数据库文件
我正在尝试使用ant和eclipse制作一个简单清单程序的jar。我已经构建了xml文件,但是我需要向buildjar目标添加一些东西,这将导致ant在jar中包含itemdatabase文件(当前位于基本目录中)。到目前为止我所拥有的Xml 使用Ant在Jar中包含数据库文件,xml,ant,Xml,Ant,我正在尝试使用ant和eclipse制作一个简单清单程序的jar。我已经构建了xml文件,但是我需要向buildjar目标添加一些东西,这将导致ant在jar中包含itemdatabase文件(当前位于基本目录中)。到目前为止我所拥有的 <target name="buildjar" depends="clean"> <jar jarfile="${build.dir}/StudioCat.jar"> <fileset dir="${base
<target name="buildjar" depends="clean">
<jar jarfile="${build.dir}/StudioCat.jar">
<fileset dir="${basedir}">
<include name="config/*"/>
</fileset>
<fileset dir="${bin.dir}">
<include name="**/*.class"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="presentation.CreateInventoryUI"/>
</manifest>
</jar>
<copy todir="${build.dir}">
<fileset dir="${basedir}">
<include name="config*/**/*"/>
</fileset>
</copy>
</target>
1)您使用.jar任务(正如您已经在做的那样):
src/
css/
java/
html/
images/
config/
3) 您的XML将位于src/config中(例如)。你的
...
几个链接:
问:您使用的是像Eclipse这样的IDE吗?类似于您包含“config”目录及其内容的方式
<fileset dir="${basedir}">
<include name="config/*"/>
<include name="itemdatabase"/> <!-- To include itemdatabase -->
</fileset>
<fileset dir="${basedir}">
<include name="config/*"/>
<include name="itemdatabase"/> <!-- To include itemdatabase -->
</fileset>