Home > Enterprise >  should we delete lib folder when we clean project in java and how to build it again after delete lib
should we delete lib folder when we clean project in java and how to build it again after delete lib

Time:11-11

I have some problem, in my friend's code there is a clean code using apache ant seems to delete lib folder as well. but when I try to create project, it fails because the lib folder is missing. then how to build the correctly using ant apache ?

this is clean code

<target name="clean" description="--> clean the project">
            <delete includeemptydirs="true">
                <fileset dir="${basedir}">
                    <exclude name="src/**" />
                    <exclude name="build.xml" />
                  <exclude name="ivy.xml" />
                </fileset>
            </delete>
        </target>

and this build code

<target name="build" description="Compile main source tree java files">
        <mkdir dir="${build.dir}" />

        <javac srcdir="${java.dir}" destdir="${build.dir}" classpathref="lib.path.id" debug="true" deprecation="true" optimize="true" failonerror="true" />
        <!-- class path properties files -->
        <copy file="${resource.dir}/log4j.properties" todir="${build.dir}" />
        <copy file="${resource.dir}/mncplaymedia.properties" todir="${build.dir}" />
        <copy todir="${build.dir}">
            <fileset dir="${resource.dir}" />
        </copy>
        
    </target>

thank you

CodePudding user response:

I think you have to build this project, then put the war or jar file in webapps on your web server (like jetty, tomcat and etc.)

  • Related