Results 1 to 3 of 3
  1. #1
    cjava is offline Member
    Join Date
    Oct 2015
    Posts
    2
    Rep Power
    0

    Default Ant built does not generate class files

    I'm using build.xml to build my src. However it failed to generate class files without any error message. By what could this situation depends?
    Thank you in advance

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    878
    Rep Power
    11

    Default Re: Ant built does not generate class files

    Have you checked your path mentioned in build.xml?
    Ramya:cool:

  3. #3
    cjava is offline Member
    Join Date
    Oct 2015
    Posts
    2
    Rep Power
    0

    Default Re: Ant built does not generate class files

    Quote Originally Posted by RamyaSivakanth View Post
    Have you checked your path mentioned in build.xml?
    hi ramyasivakanth,
    first of all, i want to thank you for the responce.
    i verificated the classpath and it's correct.
    Below, i show you the build.xml file that is generated when i execute build project with ANT.
    thanks a lot
    --------------------------------------------------------------Code Build.xml-----------------------------------------------------
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- WARNING: Eclipse auto-generated file.
    Any modifications will be overwritten.
    To include a user specific buildfile here, simply create one in the same
    directory with the processing instruction <?eclipse.ant.import?>
    as the first entry and export the buildfile again. --><project basedir="." default="build" name="pj1">
    <property environment="env"/>
    <property name="M2_REPO" value="../../../.m2/repository"/>
    <property name="ECLIPSE_HOME" value="../../Test_Eclipse/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.6"/>
    <property name="source" value="1.6"/>
    <path id="AspectJ Runtime Library.libraryclasspath">
    <pathelement location="${ECLIPSE_HOME}/plugins/org.aspectj.runtime_1.8.1.20140523140000.jar"/>
    </path>
    <path id="WebSphere Application Server v7.0 [WebSphere Application Server v7.0].libraryclasspath">
    <pathelement location="../../../../../Program Files (x86)/IBM/WebSphere/AppServer/plugins/com.ibm.ws.wccm.jar"/>
    <pathelement location="../../../../../Program Files (x86)/IBM/WebSphere/AppServer/plugins/com.ibm.ws.emf.jar"/>
    ....
    <!-- example of libraries imported -->
    ....
    </path>
    <path id="pj1.classpath">
    <pathelement location="output/classes"/>
    <pathelement location="output/test-classes"/>
    <pathelement location="${M2_REPO}/javax/el/el-api/1.0/el-api-1.0.jar"/>
    <pathelement location="${M2_REPO}/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar"/>
    .......
    <!-- example of libraries imported -->
    ......

    <pathelement location="../../../../../Java_libs_1/sqljdbc4.jar"/>
    </path>
    <target name="init">
    <mkdir dir="output/classes"/>
    <mkdir dir="output/test-classes"/>
    <copy includeemptydirs="false" todir="output/classes">
    <fileset dir="src/main/java">
    <include name="**/*.java"/>
    <include name="**/*.aj"/>
    <exclude name="**/*.java"/>
    </fileset>
    </copy>
    <copy includeemptydirs="false" todir="output/classes">
    <fileset dir="src/main/resources">
    <exclude name="**/*.java"/>
    <exclude name="otherConfigurations/**"/>
    <exclude name="**/*.java"/>
    </fileset>
    </copy>
    <copy includeemptydirs="false" todir="output/test-classes">
    <fileset dir="src/test/java">
    <include name="**/*.java"/>
    <include name="**/*.aj"/>
    <exclude name="**/*.java"/>
    </fileset>
    </copy>
    <copy includeemptydirs="false" todir="output/test-classes">
    <fileset dir="src/test/resources">
    <exclude name="**/*.java"/>
    <exclude name="**/*.java"/>
    </fileset>
    </copy>
    </target>
    <target name="clean">
    <delete dir="output/classes"/>
    <delete dir="output/test-classes"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="output/classes" includeantruntime="false" source="${source}" target="${target}">
    <src path="src/main/java"/>
    <src path="src/main/resources"/>
    <include name="**/*.java"/>
    <include name="**/*.aj"/>
    <exclude name="otherConfigurations/**"/>
    <exclude name="**/*.java"/>
    <classpath refid="pj1.classpath"/>
    </javac>
    <javac debug="true" debuglevel="${debuglevel}" destdir="output/test-classes" includeantruntime="false" source="${source}" target="${target}">
    <src path="src/test/java"/>
    <src path="src/test/resources"/>
    <include name="**/*.java"/>
    <include name="**/*.aj"/>
    <exclude name="**/*.java"/>
    <classpath refid="pj1.classpath"/>
    </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
    <copy todir="${ant.library.dir}">
    <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </copy>
    <unzip dest="${ant.library.dir}">
    <patternset includes="jdtCompilerAdapter.jar"/>
    <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    <antcall target="build"/>
    </target>
    </project>

Similar Threads

  1. generate class file during runtime?
    By balla in forum New To Java
    Replies: 5
    Last Post: 07-02-2011, 06:21 AM
  2. Generate a Class file
    By Daniel in forum New To Java
    Replies: 6
    Last Post: 04-20-2009, 05:37 AM
  3. Replies: 8
    Last Post: 04-19-2009, 05:50 PM
  4. Can we generate an array for class object?
    By gaurav2211 in forum Advanced Java
    Replies: 4
    Last Post: 03-21-2009, 04:20 AM
  5. Exception Failed to Generate Wrapper Class on WebLogic
    By christina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 02:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •