# Mit ant kompilierte war kann nicht gedebuggt werden



## glowbus (9. Oktober 2007)

Hi,

ich hab mir ein Ant-Script geschrieben, dass aus meinem Eclipse-Web-Projekt eine War erstellt und diese auf einen remote Server kopiert. Leider funktioniert mit dieser war das Remote Debugging nicht mehr. Vlt kann mir jemand weiterhelfen.


```
<?xml version="1.0" ?>
<project name="erp-system" default="main">
	<property file="build.properties" />

	<property name="compiler.level" value="1.5" />

	<property name="src" location="src/java" />
	<property name="src.conf" location="src/conf" />
	<property name="src.gen" location="src/generated" />

	<property name="output" location="build" />
	<property name="output.classes" location="${output}/classes" />
	<property name="output.axis" location="${output}/axis" />

	<property name="webcontent" location="WebContent" />
	<property name="lib" location="${webcontent}/WEB-INF/lib" />


	<property name="service.namespace" value="default.namespace" />
	<property name="endpoint.package.structure" value="default.packagestructur" />
	<property name="wsdl.class.name" value="${service.name}" />
	<property name="wsdl.folder" location="${webcontent}/wsdl" />
	<property name="wsdl.name" location="${wsdl.folder}/${wsdl.class.name}.wsdl" />

	<path id="project.class.path">
		<fileset dir="${lib}">
			<include name="**/*.jar" />
		</fileset>
		<fileset dir="/var/java/jboss-portal-2.6.1.GA/server/default">
			<include name="**/*.jar" />
		</fileset>
	</path>

	<taskdef resource="axis-tasks.properties" classpathref="project.class.path" />

	<target name="clean">
		<delete dir="${output}" />
	</target>

	<target name="init">
		<mkdir dir="${output}" />
		<mkdir dir="${output.classes}" />
	</target>

	<target name="compile" depends="compile.conf,compile.gen,compile.src" />

	<target name="checkFolder">
		<available file="${src}" type="dir" property="src.available" />
		<available file="${src.conf}" type="dir" property="src.conf.available" />
		<available file="${src.gen}" type="dir" property="src.gen.available" />
	</target>

	<target name="compile.src" if="src.available" depends="checkFolder">
		<javac srcdir="${src}" destdir="${output.classes}" classpathref="project.class.path" target="${compiler.level}" debuglevel="lines, vars, source"/>
	</target>

	<target name="compile.gen" if="src.gen.available" depends="checkFolder">
		<javac srcdir="${src.gen}" destdir="${output.classes}" classpathref="project.class.path" target="${compiler.level}" debuglevel="lines, vars, source"/>
	</target>

	<target name="compile.conf" if="src.conf.available" depends="checkFolder">
		<copy todir="${output.classes}">
			<fileset dir="${src.conf}"/>
		</copy>
	</target>

	<target name="compress">
		<war destfile="${output}/${ant.project.name}.war" webxml="${webcontent}/WEB-INF/web.xml">
			<classes dir="${output.classes}" />
			<fileset dir="${webcontent}" />
		</war>
	</target>

	<target name="deploy">
		<scp trust="true" file="${output}/${ant.project.name}.war" port="${port}" todir="${user}:${pwd}@${ip}:${targetFolder}" />
	</target>

	<target name="generate-wsdl" depends="compile">
		<delete file="${wsdl.name}" />
		<axis-java2wsdl classname="${endpoint.package.structure}.${wsdl.class.name}" style="${service.style}" namespace="${service.namespace}" location="http://${host}:${port}/${ant.project.name}/servlet/AxisServlet/${service.name}" output="${wsdl.name}" exclude="${service.exclude}">
			<classpath location="${output.classes}" />
		</axis-java2wsdl>
	</target>

	<target name="generate-wsdd">
		<mkdir dir="${output.axis}" />
		<axis-wsdl2java all="true" output="${output.axis}" verbose="false" url="${wsdl.name}" serverside="true" debug="false">
			<mapping namespace="${service.namespace}" package="${endpoint.package.structure}" />
		</axis-wsdl2java>
	</target>

	<target name="main">
		<echo>
			use:
				build  - Building the .war File
				deploy - Build and deploy the .war File
			        </echo>
	</target>

	<target name="build" depends="clean, init, compile, compress" />
	<target name="build-deploy" depends="clean, init, compile, compress, deploy" />
</project>
```

Das Kompilieren meiner Java Klassen erfolgt in in den Target:
compile.src​compile.gen​


----------

