This plugin generates DTOs for the Camel Salesforce Component.
The plugin configuration has the following properties.
Additonal properties to provide proxy information, if behind a firewall.
Sample pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <properties> <camelSalesforce.clientId>5MVG9uudbyLbNPZOFutIHJpIb2nchnCiNE_NqeYcewMCPPT8_6VV_LQF_CJ813456GxzhxZdxlGwbYI_yzHmz</camelSalesforce.clientId> <camelSalesforce.clientSecret>5630289243049151316</camelSalesforce.clientSecret> <camelSalesforce.userName>foo@bar.com</camelSalesforce.userName> <camelSalesforce.password>foopasswordCbe5V27JxD0JXYFGJIdIEWB7p</camelSalesforce.password> <camelSalesforce.loginUrl>https://myDomain.my.salesforce.com</camelSalesforce.loginUrl> <camelSalesforce.httpProxyHost>foo.bar.com</camelSalesforce.httpProxyHost> <camelSalesforce.httpProxyPort>8090</camelSalesforce.httpProxyPort> </properties> ... <build> ... <plugins> ... <!-- camel maven saleforce for creating salesforce objects --> <plugin> <groupId>org.apache.camel.maven</groupId> <artifactId>camel-salesforce-maven-plugin</artifactId> <version>2.17.1</version> <configuration> <clientId>${camelSalesforce.clientId}</clientId> <clientSecret>${camelSalesforce.clientSecret}</clientSecret> <userName>${camelSalesforce.userName}</userName> <password>${camelSalesforce.password}</password> <loginUrl default-value="https://login.salesforce.com">${camelSalesforce.loginUrl}</loginUrl> <includes> <include>Account</include> <include>Contacts</include> </includes> <httpProxyHost>${camelSalesforce.httpProxyHost}</httpProxyHost> <httpProxyPort>${camelSalesforce.httpProxyPort}</httpProxyPort> </configuration> </plugin> </plugins> </build> </project>
For obvious security reasons it is recommended that the clientId, clientSecret, userName and password fields be not set in the pom.xml. The plugin should be configured for the rest of the properties, and can be executed using the following command:
mvn camel-salesforce:generate -DcamelSalesforce.clientId=<clientid> -DcamelSalesforce.clientSecret=<clientsecret> -DcamelSalesforce.userName=<username> -DcamelSalesforce.password=<password>
The generated DTOs use Jackson and XStream annotations. All Salesforce field types are supported. Date and time fields are mapped to java.time.ZonedDateTime, and picklist fields are mapped to generated Java Enumerations.
You can customize types, i.e. use java.time.LocalDateTime instead of the default java.time.ZonedDateTime by specifying the customTypes
property like:
<plugin> <groupId>org.apache.camel</groupId> <artifactId>camel-salesforce-maven-plugin</artifactId> <configuration> <!-- ... --> <customTypes> <date>java.time.LocalDateTime</date> </customTypes> </configuration> </plugin>