Mule4- Create Custom Policy , Configuration and Deploy to Exchange

1. Mule4 Generate Custom policy template using maven Archetype.

Add the following profile to settings.xml(.m2/settings.xml), this is to recognize the maven archetype repo location.
<profiles> <profile> <id>archetype-repository</id> <repositories> <repository> <id>archetype</id> <name>Mule Repository</name> <url>https://repository-master.mulesoft.org/nexus/content/repositories/public</url> <releases> <enabled>true</enabled> <checksumPolicy>fail</checksumPolicy> </releases> <snapshots> <enabled>true</enabled> <checksumPolicy>warn</checksumPolicy> </snapshots> </repository> </repositories> </profile> </profiles>

Assuming that maven is already installed  and path is set to recognize mvn command.

maven command to generate policy using maven archetype(provided by MuleSoft).

mvn -Parchetype-repository archetype:generate \

-DarchetypeGroupId=org.mule.tools \

-DarchetypeArtifactId=api-gateway-custom-policy-archetype \

-DarchetypeVersion=1.2.0 \

-DgroupId=test \

-DartifactId=hello\

-Dversion=1.0.0-SNAPSHOT \

-Dpackage=mule-policy



change the "groupId" corresponding  to the business group where policy need to be published.

To get groupId, for a business group Navigate  to Access Management-> Organization -> Business Group (screenshot shown below)

















change the version if required from 1.0.0-SNAPSHOT to suitable value and execute the above mvn command.





Comments

Popular posts from this blog

Mulesoft Certified Developer-Level2 - Study Material

Mule4- Salesforce Connector- Version-10.4.2 - Create job bulk api v 2 - ClientInputError:LineEnding is invalid on user data. Current LineEnding setting is LF

Salesforce Certified MuleSoft Platform Architect - Level1 - Reference Notes