Question

I am using an external API with SOAP.

I would like in the buildr task, to automatically create jar of the web service client from the WSDL remote location, using axis2 (since I am writing in Java) , and add it to the war for compilation.

This way I can know if I need to change the code if the WSDL was changed.

How can I do it in buildr?

This is my current code:

desc 'Building API project'
    define 'API' do
        compile.with projects('common'),AMAZON,ACTIVATION,ANTLR,AOPALLIANCE,ASM,ASPECTJ,AXIS,BRAINTREE,C3P0,BEANUTILS,COLLECTIONS,COMMONS_CODEC,DISCOVERY,HTTPCLIENT,COMMONS_IO,LANG,LOGGING,VALIDATOR,DAO,DAOHIBERNATE,DOM4J,EHCAHCE,GUAVA,
        package(:war).with :libs=>project('common')
    end
Was it helpful?

Solution

you would need to create a task that automatically generates the client-classes from the wsdl and then include those generated classes in your project.

you could either build a jar directly and add this as a dependency to your list, or directly link the classes to your compilation step.

here is the documentation for the WSDL2Java command line utility, that you could use for this: http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients.html#adb

even if this might not be helpful for your specific question, but have a look at the buildr-examples repo: https://github.com/phoet/buildr-examples

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top