Maven/S-RAMP integration and its use from within Eclipse
objectiser Aug 23, 2012 3:57 AMThe Switchyard team have discussed the possibility of allowing a contract (wsdl + associated xsds) to be stored in a separate maven artifact (jar) and referenced from the switchyard app, thus allowing more than one switchyard app to share the same contract details without having to include them directly in their own jar.
If this is possible, then I believe the following describes how this particular feature can be used:
1) The common shared artifacts (wsdl/xsd) are defined in a maven project and deployed to the s-ramp repo.
2) Each switchyard app project that requires the contract will reference it as a dependency within their pom - thus indirectly retrieving the artifact when the switchyard app is built.
3) At runtime deployment, both the switchyard app and the shared artifacts would be retrieved from the repository and deployed into switchyard.
Question: Does maven have a role to play here? Rather than switchyard having to know what the dependencies are for a particular app - it could leverage the maven dependencies to retrieve all other artifacts of interest. (This is out of scope for the repo itself, but might provide some useful capability for switchyard's use of the repo).
The usecase above is quite straightforward, as the shared contract will have its own GAV details provided when it is deployed, and these same details can be used to retrieve it.
The more interesting usecase, which may or may not be possible, is:
1) A user develops a Switchyard app that provides a service - the contract for this service is defined by wsdl/xsd files that are contained within the app. When deployed to s-ramp via maven, the app will have its own GAV details, and the s-ramp repo will create the derived artifacts associated with the wsdl/xsd etc.
2) Another user now wishes to create an app (could be switchyard or might just be a web service client), the question is how do they (from their Eclipse environment) retrieve the contract details:
a) Straightforward answer is they would have to search the repo (using the UI) and manually download the relevant derived artifacts - Q: is it possible to download a wsdl independent of the artifact in which it is contained by reference to its derived artifact?
b) ???? - not sure if maven has a role to play here?
One possibility may be that a modified version of the containing artifact's GAV details could be used to refer to a specific contained artifact, or a class of artifacts, e.g. if the binary GAV is com.acme:orders:1.0, then possibly com.acme:orders/OrderService.wsdl:1.0 could retrieve just the wsdl - or com.acme:orders/contract:1.0 may retrieve the artifacts defined by the class 'contract'.
We also need to consider cases where client projects may or may not be able to reference the contract via a maven dependency - some projects will require the contract to be locally defined.
Thoughts?