<property> is a task as all others, therefore you can use that everywhere. If your properties file contains 'just' properties for that generation, placing the task just in front of the <clientgen> is a good idea. Usually you have a build.properties with all properties for the build, like java source directory, javac target, etc. Then a common place is directly under <project>.
Jan >-----Ursprüngliche Nachricht----- >Von: [email protected] >[mailto:[email protected]] >Gesendet: Mittwoch, 18. Februar 2009 19:26 >An: Ant Users List >Betreff: Re: Reading a property from a file > >Thanks for your reply. Regarding the property file directive, >"<property>", where are you actually loading the property >"PROVISIONING_SERVICE_WSDL_URL" from the file and assigning it >to a variable? > > - Dave > >> -------Original Message------- >> From: David Weintraub <[email protected]> >> Subject: Re: Reading a property from a file >> Sent: Feb 18 '09 18:10 >> >> What about <property file="Property_File_Name"/> ? >> >> What I normally do is something like this: >> >> <property name="property.file" >> value="${basedir}/default_property_file_name.properties"/> >> <property file=${property.file}"/> >> >> That way, I can put the property file name on the command line, or >> read in the default property file if it exists. >> >> You can also override any property setting in your >build.xml by simply >> placing it on the command line: >> >> So do this: >> >> <target name="gen-web-svc-client-jar"> >> <property name="provisioning.service.wsdl.file" >> >name="${basedir}/wsdl_files/ProvisioningService.wsdl >> <clientgen >> >wsdl="${provisioning.service.wsdl.file}" >> >> destFile="${deployment}/APP-INF/lib/ProvisioningServiceClient.jar" >> >> packageName="com.myco.nps.regui.provisioning.client" >> serviceName="ProvisioningService" >> .... >> >> Then you can do this on the command line: >> >> $ ant >-Dprovisioning.service.wsdl.file=http://99.99.99.99:9999/Provis >ioningAccountService/ProvisioningAccountService?WSDL >> >> The <property> task that sets provisioning.service.wsdl.file will be >> overridden by the command line setting. >> >> On Wed, Feb 18, 2009 at 12:17 PM, <[email protected]> wrote: >> > Hi, >> > >> > I'm uisng Ant 1.6. I have this target ... >> > >> > <target name="gen-web-svc-client-jar"> >> > <clientgen >> > >wsdl="${basedir}/wsdl_files/ProvisioningService.wsdl" >> > >destFile="${deployment}/APP-INF/lib/ProvisioningServiceClient.jar" >> > >packageName="com.myco.nps.regui.provisioning.client" >> > >serviceName="ProvisioningService" >> > classpath="${java.class.path}" >> > > >> > <classpath> >> > <path refid="project.class.path" /> >> > </classpath> >> > </clientgen> >> > </target> >> > >> > For the property, >'wsdl="${basedir}/wsdl_files/ProvisioningService.wsdl"', I >would prefer to read this property out of a properties file I >have, which has the line ... >> > >> > >PROVISIONING_SERVICE_WSDL_URL=http://99.99.99.99:9999/Provision >ingAccountService/ProvisioningAccountService?WSDL >> > >> > >> > How can I tell ant to get the value from there? >> > >> > Thanks, - Dave >> > >> > >--------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> >> >> >> -- >> -- >> David Weintraub >> [email protected] >> >> >--------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [email protected] >For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
