CruiseControl & Ant Problem

pizza1234

Erfahrenes Mitglied
Hallo,
ich hab ein Problem, wenn CruiseControl mein Projekt bauen soll.
CruiseControl läuft tadellos, holt sich auch per svn-Task die Sourcen aus dem Repository aber beim Bauen gibt es eine Fehlermeldung. Ich hab schon alle möglichen Einstellungen probiert! Der normale Build ohne CruiseControl funktioniert einwandfrei!

Hier erstmal die Konfiguration:
die config.xml
Code:
<cruisecontrol>

  <project name="etss" buildafterfailed="true">
    <!-- Bootstrappers are run every time the build runs,
        *before* the modification checks -->
	<!--
    <bootstrappers>
      <currentbuildstatusbootstrapper file="logs/etss/buildstatus.txt"/>
    </bootstrappers>
	-->
	
    <!-- more recent versions of CC should use the listener below, instead of the
         currentbuildstatusbootstrapper, currentbuildstatuspublisher combination.
         NOTE: Must match filename in CC reporting/jsp - override.properties: user.build.status.file -->
    <listeners>
        <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
    </listeners>
	
    <!-- Defines where cruise looks for changes, to decide whether to run the build -->
    <modificationset quietperiod="10">
      <svn localworkingcopy="projects/etss" />
    </modificationset>

    <!-- Configures the actual build loop, how often and which build file/target -->
    <schedule interval="60">
      <ant anthome="apache-ant-1.7.0"
           buildfile="cc_etss_build.xml"
           target="build"
           uselogger="true"
           usedebug="false"/>
    </schedule>

    <!-- directory to write build logs to -->
    <log>
		<merge dir="projects/${project.name}/docs"/>
    </log>
    
    <!-- Publishers are run *after* a build completes -->
    <publishers>
		<!--
	<onsuccess>
		<artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/deploy/${project.name}.war"/>
	</onsuccess>
	-->
      <currentbuildstatuspublisher file="logs/etss/buildstatus.txt"/>


    </publishers>
  </project>
  
</cruisecontrol>

das Delegationsskript:
Code:
<!-- Delegating build script, used by cruisecontrol to build etss
     Note that the basedir is set to the checked out project -->
<project name="etss" default="build" basedir=".">

	<!-- libs nach apache-ant-1.6.5/lib -->
	<path id="svn.classpath">
	        <fileset dir="apache-ant-1.7.0" includes="*.jar"/>
	</path>

	<!--
	<taskdef resource="svntask.properties" classpathref="svn.classpath"/>
	-->
	<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svn.classpath" />
   
    <!-- SVN-Target -->
	<target name="svn">
		<delete dir="projects/etss"/>
		<svn username="xxx" password="xxx">
			<checkout url="http://xxx/svn/etss_pm/trunk" 
					revision="HEAD" 
					destPath="projects/etss" />
		</svn>
	</target>
	
	
	<target name="build" depends="svn">
	<!-- Get the latest from SVN-->
	<!-- Call the target that does everything -->
		<ant antfile="projects/etss/build.xml" target="build"/>
	</target>
    
</project>

hier das normale build-script: (gekürzt)
Code:
<project name="${project.name}" basedir="." default="help">

	<property file="build.properties"/>
    
    <property name="app.home" 				value="${app.home}" />
    <property name="app.name" 				value="${project.name}" />

    <property name="src.dir" 				value="src" />
	<property name="domain.dir" 			value="de/etss/core/db/domain"/>
	<property name="deploy.dir" 			value="deploy" />
	<property name="web.dir" 				value="web" />
	<property name="web-inf.dir" 			value="${web.dir}/WEB-INF" />
	<property name="lib.dir" 				value="${web-inf.dir}/lib" />
	<property name="lib.security.dir" 		value="${lib.dir}/security" />
	<property name="tld.dir" 				value="${web-inf.dir}/tld" />
	<property name="meta-inf.dir" 			value="${web.dir}/META-INF" />
	<property name="docs.dir" 				value="docs" />
	<property name="classes.dir" 			value="${web-inf.dir}/classes" />
    <property name="jsp.dir" 				value="${web-inf.dir}/jsp" />
	<property name="hibernate-domain.dir" 	value="${src.dir}/${domain.dir}" /> 
	<property name="hibernate-hbm.dir" 		value="${src.dir}/${domain.dir}" /> 
	<property name="javadoc.pkg.top" 		value="de.*" />
	
	<property name="script.dir" 			value="script" />
		
	<property name="test.home"        		value="test"/>
	<property name="test.build.dir"   		value="testbuild"/>
	<property name="test.lib.dir"     		value="${lib.dir}/test"/>
	<property name="test.dir" 				value="test"/>
	<property name="testclasses" 			value="${web-inf.dir}/classes/test" />
	<property name="testreports.dir" 		value="${docs.dir}/junit-reports"/>
	<property name="testhtml.dir" 			value="${testreports.dir}/html"/>

	<property name="hibernate.dir" 			value="${app.home}/hibernate" />
	
    <property name="build.dir" 				value="build" />
	<property name="build.classes" 			value="${build.dir}/WEB-INF/classes" />
	<property name="build.lib" 				value="${build.dir}/WEB-INF/lib" />


	
	<!-- set compile-options -->
	<property name="compile.debug"       	value="true"/>
	<property name="compile.deprecation" 	value="true"/>
	<property name="compile.optimize"    	value="true"/>
		

	<!-- set compilation-classpath -->
	<path id="compile.classpath">

		<pathelement location="${classes.dir}" />
		<fileset dir="${lib.dir}">
			<include name="*.jar" />
			<include name="*.zip" />
		</fileset>
		<fileset dir="${lib.security.dir}">
			<include name="*.jar" />
			<include name="*.zip" />
		</fileset>

		<!-- Tomcat Jars -->
	<!--	<fileset dir="${tomcat.home}/lib">
			<include name="*.jar" />
		</fileset>
		<fileset dir="${tomcat.home}/common/lib">
			<include name="*.jar" />
		</fileset>
		<pathelement location="${tomcat.home}/classes" />
		<pathelement location="${tomcat.home}/common/classes" />-->

	</path>
	
	
	<!-- set compilation-test-classpath -->
    <path id="test.classpath">
           	<path refid="compile.classpath"/>
			<pathelement location="${test.build.dir}"/>
            <pathelement location="${build.dir}"/>
            <pathelement location="${test.lib.dir}" />
			<fileset dir="${test.lib.dir}">
				<include name="*.jar" />
				<include name="*.zip" />
			</fileset>
    </path>
	


	
	<!-- Prepare-Targets -->
	<target name="init">
		<echo message="Tomcat Home = ${tomcat.home}"/>
		<echo message="Webapps Home = ${web.dir}"/>
		<mkdir dir="${deploy.dir}" />
		<mkdir dir="${classes.dir}" />
		<mkdir dir="${docs.dir}" />
		<mkdir dir="${docs.dir}/api" />
		<mkdir dir="${build.dir}" />
		<mkdir dir="${build.dir}/WEB-INF" />
		<mkdir dir="${build.classes}" />
		<mkdir dir="${build.lib}" />
		<mkdir dir="${build.dir}/WEB-INF/script"/>
		<mkdir dir="${test.build.dir}"/>
	</target>


	<!-- Compile-Target -->
	<target name="compile" depends="init">
		<echo message="SRC Home: ${src.dir}" />
		
		<javac srcdir="${src.dir}" destdir="${classes.dir}"	
			includes="**/*.java"
			encoding="utf8"
			debug="${compile.debug}"
			optimize="${compile.optimize}"
			deprecation="${compile.deprecation}">
			<classpath refid="compile.classpath" />
		</javac>
		
		<copy  todir="${classes.dir}">
			<fileset dir="${src.dir}"  excludes="**/*.java"/>
		</copy>
	</target>
	
	
	<!-- Build-Target -->
	<target name="build" depends="compile">
		<copy todir="${build.dir}">
			<fileset dir="${web.dir}"/>
		</copy>
		
		<copy todir="${build.classes}">
			<fileset dir="${classes.dir}">
			</fileset>
		</copy>

		<copy todir="${build.classes}">
			<fileset dir="${src.dir}">
				<include name="**/*.properties"/>
				<include name="**/*.prop"/>
			</fileset>
		</copy>

		<copy todir="${build.lib}">
			<fileset dir="${lib.dir}">
				<excludesfile name="${lib.dir}/servlet-api.jar"/>
			</fileset>
			<fileset dir="${lib.security.dir}" />
		</copy>
		
		<copy todir="${build.dir}/WEB-INF/script/runtime">
			<fileset dir="${script.dir}/runtime" />
		</copy>
	</target>
</project>



und dann hier jetzt die Fehermeldung von CruiseControl
Code:
  <build error="/opt/cruisecontrol/cc_etss_build.xml:29: The following error occurred while executing this line: /opt/cruisecontrol/projects/etss/build.xml:276: /opt/cruisecontrol/web/WEB-INF/lib not found." time="5 seconds">
    <target name="svn" time="5 seconds">
      <task location="/opt/cruisecontrol/cc_etss_build.xml:17: " name="delete" time="0 seconds">
        <message priority="info"><![CDATA[Deleting directory /opt/cruisecontrol/projects/etss]]></message>
      </task>
      <task location="/opt/cruisecontrol/cc_etss_build.xml:18: " name="svn" time="5 seconds">
        <message priority="info"><![CDATA[<Checkout> started ...]]></message>
        <message priority="info"><![CDATA[<Checkout> finished.]]></message>
      </task>
    </target>
    <target name="build" time="0 seconds" />
    <stacktrace><![CDATA[/opt/cruisecontrol/cc_etss_build.xml:29: The following error occurred while executing this line:
/opt/cruisecontrol/projects/etss/build.xml:276: /opt/cruisecontrol/web/WEB-INF/lib not found.
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:541)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:369)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.Main.runBuild(Main.java:698)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: /opt/cruisecontrol/projects/etss/build.xml:276: /opt/cruisecontrol/web/WEB-INF/lib not found.
	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:422)
	at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:88)
	at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:244)
	at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.iterator(BaseResourceCollectionContainer.java:120)
	at org.apache.tools.ant.types.Path.iterator(Path.java:687)
	at org.apache.tools.ant.types.Path.iterator(Path.java:684)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
	at org.apache.tools.ant.types.resources.Union.list(Union.java:67)
	at org.apache.tools.ant.types.Path.list(Path.java:356)
	at org.apache.tools.ant.types.Path.addExisting(Path.java:327)
	at org.apache.tools.ant.types.Path.addExisting(Path.java:315)
	at org.apache.tools.ant.types.Path.concatSpecialPath(Path.java:552)
	at org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:512)
	at org.apache.tools.ant.AntClassLoader.setClassPath(AntClassLoader.java:353)
	at org.apache.tools.ant.AntClassLoader.<init>(AntClassLoader.java:240)
	at org.apache.tools.ant.Project.createClassLoader(Project.java:328)
	at org.apache.tools.ant.util.ClasspathUtils.getUniqueClassLoaderForPath(ClasspathUtils.java:219)
	at org.apache.tools.ant.util.ClasspathUtils.getClassLoaderForPath(ClasspathUtils.java:194)
	at org.apache.tools.ant.util.ClasspathUtils$Delegate.getClassLoader(ClasspathUtils.java:445)
	at org.apache.tools.ant.taskdefs.DefBase.createLoader(DefBase.java:142)
	at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:197)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
	at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:96)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:367)
	... 17 more
--- Nested Exception ---
/opt/cruisecontrol/projects/etss/build.xml:276: /opt/cruisecontrol/web/WEB-INF/lib not found.
	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:422)
	at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:88)
	at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:244)
	at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.iterator(BaseResourceCollectionContainer.java:120)
	at org.apache.tools.ant.types.Path.iterator(Path.java:687)
	at org.apache.tools.ant.types.Path.iterator(Path.java:684)
	at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
	at org.apache.tools.ant.types.resources.Union.list(Union.java:67)
	at org.apache.tools.ant.types.Path.list(Path.java:356)
	at org.apache.tools.ant.types.Path.addExisting(Path.java:327)
	at org.apache.tools.ant.types.Path.addExisting(Path.java:315)
	at org.apache.tools.ant.types.Path.concatSpecialPath(Path.java:552)
	at org.apache.tools.ant.types.Path.concatSystemClasspath(Path.java:512)
	at org.apache.tools.ant.AntClassLoader.setClassPath(AntClassLoader.java:353)
	at org.apache.tools.ant.AntClassLoader.<init>(AntClassLoader.java:240)
	at org.apache.tools.ant.Project.createClassLoader(Project.java:328)
	at org.apache.tools.ant.util.ClasspathUtils.getUniqueClassLoaderForPath(ClasspathUtils.java:219)
	at org.apache.tools.ant.util.ClasspathUtils.getClassLoaderForPath(ClasspathUtils.java:194)
	at org.apache.tools.ant.util.ClasspathUtils$Delegate.getClassLoader(ClasspathUtils.java:445)
	at org.apache.tools.ant.taskdefs.DefBase.createLoader(DefBase.java:142)
	at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:197)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
	at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:96)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:367)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.Main.runBuild(Main.java:698)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)]]></stacktrace>
  </build>

Ich weiß nicht, warrum er immer nach /opt/cruisecontrol/web/WEB-INF/lib sucht, eigentlich muss er nach /opt/cruisecontrol/etss/web/WEB-INF/lib suchen!
Die Verzeichnisshierarchie ist:
op/cruisecontrol/projects
-etss
--src
--build
--usw.


Vielleicht weiß einer von euch ja, woran es liegt?


Grüße,
Peter
 
Hi,
ich habs!

Es war das Delegationsfile:

Code:
<!-- Delegating build script, used by cruisecontrol to build etss
     Note that the basedir is set to the checked out project -->
<project name="etss" default="build" basedir="projects/etss">

	<!-- libs nach apache-ant-1.6.5/lib -->
	<path id="svn.classpath">
	        <fileset dir="../../apache-ant-1.7.0" includes="*.jar"/>
	</path>

	<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svn.classpath" />
   
    <!-- SVN-Target -->
	<target name="svn">
		<delete dir="."/>
		<svn username="xxx" password="xxx">
			<checkout url="http://xxx/svn/etss_pm/trunk" 
					revision="HEAD" 
					destPath="." />
		</svn>
	</target>
	
	
	<target name="build" depends="svn">
	<!-- Get the latest from SVN-->
	<!-- Call the target that does everything -->
		<ant antfile="build.xml" target="deploy" />
	</target>
    
</project>

Grüße
Peter
 
Zurück