Using Gen 8.6 EJB Web Services under IBM WebSphere Liberty.
Implementing WS-Security deployment and need to be able to automate the adding of a security policy policy-attachments-server.xml file to the directory "model.ief\java\SERVER_MANAGER\META_INF". Also require:
- The content of that file to be updated for the Server PStep name inside the Server Manager (only 1 PStep per Server Manager)
- The file should also be incorporated into the SERVER_MANAGER.jar file inside the assembled .ear file.
Already using a customised Build Tool deploy_ear.scr file BT script and customisation scripts from article 387712 Customize the content of a Gen EJB/EJB Web Service ejb-jar.xml file.
The policy-attachments-server.xml file has this content for a PStep with name ABCD_EFGH_IJKL.
Note the 2 different types of PStep name format in bold:
<attachments xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:sp13="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200802" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:PolicyAttachment wsdlNamespace="http://tempuri.org/AbcdEfghIjkl/">
<wsp:AppliesTo>
<wsp:URI>http://tempuri.org/AbcdEfghIjkl/#wsdl11.service(ABCD_EFGH_IJKL)</wsp:URI>
</wsp:AppliesTo>
<wsp:Policy wsu:Id="UsernameTokenwithPassword">
<wsp:ExactlyOne>
<wsp:All>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
</wsp:Policy>
</sp:UsernameToken>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</wsp:PolicyAttachment>
</attachments>
The Build Tool Assemble allows additional files to be manually added to the root of the .ear file or in /lib or a created folder. However that will not satisfy this requirement.