1 Reply Latest reply on Mar 30, 2006 3:37 PM by anbuanand

    having trouble with build.xml while trying to deploy a portl

    anbuanand

      Hi
      I have written my own fileupload portlet and I am trying to test this on JBoss Portal.
      I have trouble getting my ant build file to compile. I know this may not be a portal specific question and please feel free to kick this question out, if this post is seen to be irrelevant.
      I am a newcomer and I am trying to observe the rules for posting.

      Here is my Ant build.xml file:

      ---------------

      <project basedir="." default="compile" name="PortalMar28">
       <property name="src.dir" value="src"></property>
      
       <property name="build.dir" value="${basedir}/build"></property>
       <property name="build.lib" value="${build.dir}/lib"></property>
       <property name="dist.dir" value="dist"></property>
       <property name="classes.dir" value="${build.dir}/classes"></property>
       <property name="build.etc" value="${src.dir}/etc"></property>
       <property name="build.resources" value="${src.dir}/resources"></property>
       <property name="lib.dir" value="lib"></property>
       <property name="web-inf.dir" value="WEB-INF"></property>
       <property name="war.name" value="concepts"></property>
       <property file="../common.properties"></property>
       <property name="libs.ant" value="${lib.dir}/explode.jar;${lib.dir}/portal-common-lib.jar;${lib.dir}/portal-core-lib.jar"></property>
      
       <property name="libs" value="${libs.api};${libs.ant}"></property>
       <available classname="org.apache.tools.ant.taskdefs.CloverCompilerAdapter" property="clover.available"></available>
       <!-- Main Target -->
      
       <target name="prepare">
       <mkdir dir="${build.dir}"></mkdir>
       <mkdir dir="${classes.dir}"></mkdir>
       <mkdir dir="${dist.dir}"></mkdir>
       </target>
      
      
      
       <!--
       <target depends="prepare" name="clover-no" unless="clover.available">
       <property name="compiler" value="modern"></property>
       </target>
       -->
      
      
       <target name="compile">
       <javac classpath="${libs}" compiler="${compiler}" debug="on" deprecation="on" destdir="${classes.dir}" optimize="on" srcdir="${src.dir}">
       <include name="${src.dir}/main/org/apache/commons/fileupload/**/*.java"></include>
       <include name="${src.dir}/main/com/portalbook/portlets/**/*.java"></include>
       <include name="${src.dir}/main/com/portalbook/portlets/content/**/*.java"></include>
      
       <!--
       <src>
       <pathelement location="${src.dir}"></pathelement>
       </src>
       -->
       <classpath>
       <fileset dir="${lib.dir}">
       <include name="**/*.jar">
       </include>
       </fileset>
       </classpath>
       </javac>
      
      
       <war destfile="${dist.dir}/${war.name}.war" webxml="WEB-INF/web.xml">
       <classes dir="${classes.dir}"></classes>
       <lib dir="${lib.dir}"></lib>
       <webinf dir="${web-inf.dir}"></webinf>
       </war>
      
      
       <!-- create concepts-lib.jar -->
       <jar jarfile="${build.lib}/concepts-lib.jar">
       <fileset dir="${classes.dir}"></fileset>
       </jar>
      
       <!-- create concepts.war -->
       <jar jarfile="${build.lib}/concepts.war" manifest="${build.etc}/concepts-war.mf">
       <fileset dir="${build.resources}/concepts-war"></fileset>
       </jar>
      
      
       <!-- concepts.ear -->
       <copy todir="${build.resources}/concepts-ear">
       <fileset dir="${build.lib}" includes="concepts.war,concepts-lib.jar">
       </fileset>
       </copy>
       <copy todir="${build.resources}/concepts-ear/META-INF">
       <fileset dir="${build.resources}/etc" includes="application.xml">
       </fileset>
       </copy>
      
       <jar jarfile="${build.lib}/concepts.ear">
       <fileset dir="${build.resources}/concepts-ear" includes="concepts.war,concepts-lib.jar">
       </fileset>
       </jar>
      </target>
      
       <target depends="compile" name="explode">
       <taskdef classname="org.jboss.nukes.common.ant.Explode" classpath="${libs}" name="explode"></taskdef>
       <explode file="${build.lib}/concepts.ear" name="concepts.ear" todir="${build.lib}/exploded"></explode>
       </target>
      
      
       <target name="clean">
       <delete dir="${build.dir}">
       </delete>
       <delete dir="${dist.dir}">
       </delete>
       </target>
      
      </project>


      ------------

      If anybody can point out why my build file won't recognize my java files, I would be grateful.

      Thanks in advance