You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by dbhalsema <db...@gmail.com> on 2008/02/08 01:57:54 UTC

buildfile not producing subpackages

I have a project in eclipse and when I run "build generate" it generates the
classes in the main package (com.sparta.customer) but not in the subpackages
(com.sparta.customer.impl) in the produced buildfile.  what could be wrong? 
here's my buildfile (below).  Also I get a "can't find
com.sun.tools.ws.ant.WSImport" error.Thanks in advance.

<?xml version="1.0"?>
<project name="Customer" default="build">
	<property file="build.properties"/>

	<property name="app" value="customer"/>
	<property name="wsdl" value="./etc/WEB-INF/wsdl/Customer.wsdl"/>
	<property name="package" value="com.sparta.customer"/>
	<property name="src" value="./src"/>

	<path id="jaxws.path">
		<pathelement path="${jaxws.home}"/>

		<fileset dir="lib">
			<include name="*.jar"/>
		</fileset>
	</path>
	
	<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
		<classpath path="jaxws.path"/>
	</taskdef>
	
	<target name="init">
		<mkdir dir="build"/>
		
		<mkdir dir="./build/${app}/WEB-INF/classes"/>
	</target>

	<target name="build" depends="generate" >
		<copy todir="./build/${app}">
		    <fileset dir="./etc"/>
		</copy>
		<javac srcdir="src" destdir="./build/${app}/WEB-INF/classes">
			<classpath refid="jaxws.path" />
		</javac>
	</target>

	<target name="generate" depends="init">
		<wsimport wsdl="${wsdl}"
			sourcedestdir="${src}"
			destdir="./build/${app}/WEB-INF/classes"
			package="${package}"/>
	</target>
	
	<target name="clean">
		<delete dir="build"/>
	</target>

</project>



-- 
View this message in context: http://www.nabble.com/buildfile-not-producing-subpackages-tp15347367p15347367.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: buildfile not producing subpackages

Posted by Ja...@rzf.fin-nrw.de.
> I have a project in eclipse and when I run "build generate" 
> it generates the
> classes in the main package (com.sparta.customer) but not in 
> the subpackages
> (com.sparta.customer.impl) in the produced buildfile.  what 
> could be wrong? 
> here's my buildfile (below).  Also I get a "can't find
> com.sun.tools.ws.ant.WSImport" error.Thanks in advance.


This second error could be the root cause for the first one ...


> <project name="Customer" default="build">
> 	<property file="build.properties"/>
> 
> 	<property name="app" value="customer"/>

You know that  ${ant.project.name} is 'Customer' as specified on
<project>?


> 	<property name="wsdl" value="./etc/WEB-INF/wsdl/Customer.wsdl"/>
> 	<property name="package" value="com.sparta.customer"/>
> 	<property name="src" value="./src"/>
> 
> 	<path id="jaxws.path">
> 		<pathelement path="${jaxws.home}"/>

I hope ${jaxws.home} is set properly ...



> 
> 		<fileset dir="lib">
> 			<include name="*.jar"/>
> 		</fileset>
> 	</path>


Please insert a 
	<echo message="${toString:jaxws.path}"/>
and check that path if all is present.


> 	<target name="init">
> 		<mkdir dir="build"/>
> 		<mkdir dir="./build/${app}/WEB-INF/classes"/>
> 	</target>

You can remove the first <mkdir> statement as the second will create
that too.
'build' is a relative path to ${basedir} and '.' points to ${basedir},
so
   build == ./build



> 	<target name="build" depends="generate" >
> 		<copy todir="./build/${app}">
> 		    <fileset dir="./etc"/>

usually just 'etc' instead of './etc' but that shouldnt have any
influences ...


> 		</copy>
> 		<javac srcdir="src" 
> destdir="./build/${app}/WEB-INF/classes">
> 			<classpath refid="jaxws.path" />
> 		</javac>
> 	</target>
> 
> 	<target name="generate" depends="init">
> 		<wsimport wsdl="${wsdl}"
> 			sourcedestdir="${src}"
> 			destdir="./build/${app}/WEB-INF/classes"


I would introduce a property for web-classes like
	<property name="build.dir"   value="build"/>
	<property name="web.classes"
value="${build.dir}/${app}/WEB-INF/classes"/>



Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org