Hi Pranathi,

Is your <project> element wrapped in a <cruisecontrol> element? I'm assuming
it is otherwise you'd get a different error, but this is required for CC.Net
to even read the file.

When I add the <cruisecontrol> element I then get the message you mentioned.
This is because you need to wrap the call to build the project in a task to
call the java compiler. I don't know what the compiler is, but you'd need to
add an <exec> task since CC.Net doesn't support Java natively.

Your config would then look something like:

<project name="JavaTest">
        <workingDirectory>C:\WorkArea\</workingDirectory>
        <sourcecontrol type="svn">
             <trunkUrl>http://localhost/svn/</trunkUrl>
             <workingDirectory>C:\WorkArea\</workingDirectory>
        </sourcecontrol>

       <tasks>
                <exec>
                        <!-- Configure the exec task -->
                        <property name="srcdir"   value="C:/WorkArea/"/>
                        <property name="builddir" value="build"/>
                        <property name="distdir"  value="dist"/>

                        <!-- Rest of config omitted -->
                </exec>
        </tasks>
        <!-- Rest of config omitted -->
</project>


Craig

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Pranathi
Sent: Friday, 19 December 2008 7:26 a.m.
To: ccnet-user
Subject: [ccnet-user] Re: ant integration



Hi Daniel,

I found the issue. I did not embed the above code in <task> tag. Once
I added the <task> tag . It worked.

Now I am trying to add the build.xml directly into ccnet.config
instead of using ant. I get an error message
"Unable to instantiate CruiseControl Projects from configuration.
Missing required elemnets from configuration".

Without using ant/nant I want to build java projects using CC (Javac
compiler)

<project name="JavaTest">
        <workingDirectory>C:\WorkArea\</workingDirectory>
        <sourcecontrol type="svn">
             <trunkUrl>http://localhost/svn/</trunkUrl>
             <workingDirectory>C:\WorkArea\</workingDirectory>
        </sourcecontrol>

       <tasks>
        <property name="srcdir"   value="C:/WorkArea/"/>
        <property name="builddir" value="build"/>
        <property name="distdir"  value="dist"/>

          <target name="init">
                  <mkdir dir="${builddir}"/>
                  <mkdir dir="${distdir}"/>
                  </target>

                   <target name="build" depends="init"
description="build everything under ${srcdir}" >
                   <javac srcdir="${srcdir}" destdir="${builddir}"/>
                   </target>

                   <target name="dist" depends="build"
description="generate the distribution" >
                   <jar jarfile="${distdir}/javatest.jar" basedir="$
{builddir}">
                   </jar>
                   </target>

                    <target name="run" depends="dist">
                    <java jar="${distdir}/javatest.jar" fork="true" />
                    </target>

                    <target name="clean" description="clean up" >
                   <delete dir="${builddir}"/>
                   <delete dir="${distdir}"/>
                   </target>
  </tasks>
      <publishers>
          <email from="[email protected]"
mailhost="ny01msg001.mhf.mhc"  includeDetails="TRUE">
                <users>
                        <user name="XYZ" group="buildmaster"
address="[email protected]"/>
                </users>

                <groups>
                        <group name="buildmaster" notification="always"/>
                </groups>
        </email>
    </publishers>
    </project>



Thanks,
Pranathi


On Dec 18, 12:33 pm, Daniel Hommel <[email protected]>
wrote:
> Daniel Hommel writes:
> > Pranathi writes:
> >> Hi Daniel
>
> >> I used the following in ccnet.config but I got the same error
>
> >> <exec>
> >>         <executable>C:\apache-ant-1.7.1\bin\ant.bat</executable>
> >>         <buildArgs>-logger org.apache.tools.ant.XmlLogger -logfile C:
> >> \WorkArea\build_log.xml C:\WorkArea\build.xml</buildArgs>
> >>  </exec>
>
> >> Thanks,
> >> Pranathi
>
> > Hi Pranathi,
>
> > could you show me the rest of your configuration? The "unused node
> > detected" message is an indicator for typos in element names or usage of
> > unsupported elements. This happens for example when people use the docs
> > for the development versions and have a release version installed that
> > doesn't support a specific setting.
>
> > regards,
>
> > Daniel
>
> BTW, the advice to use elements instead of attributes seems to be wrong.
> I thought NetReflector doesn't handle attributes, but in the docs it
> seems like it doesn't care which way you provide the settings...
>
> regards,
>
> Daniel- Hide quoted text -
>
> - Show quoted text -

Reply via email to