Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 使用Ant在Jar中包含数据库文件_Xml_Ant - Fatal编程技术网

Xml 使用Ant在Jar中包含数据库文件

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

我正在尝试使用ant和eclipse制作一个简单清单程序的jar。我已经构建了xml文件,但是我需要向buildjar目标添加一些东西,这将导致ant在jar中包含itemdatabase文件(当前位于基本目录中)。到目前为止我所拥有的

<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任务(正如您已经在做的那样):

2) 在项目的“src/”下通常有几个子文件夹:

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>