This maven plugin was inspired by and partly reuses code of the https://github.com/forge/plugin-hibersap.
The intention is to generate Hibersap Bapi classes by accessing the SAP RFC_READ_TABLE module.
Make sure that sapjco native libray is on java.library.path. This could be set by Environment variable MAVEN_OPTS.
A file named sap-connection.properties must contain the following connection details
#JCo properties
jco.context=org.hibersap.execution.jco.JCoContext
jco.client.client=001
jco.client.user=sapuser
jco.client.passwd=saphost
jco.client.lang=en
jco.client.ashost=saphost.example.com
jco.client.sysnr=00
jco.destination.pool_capacity=1
#Session-manager properties
session-manager.name=SM001
Details can be seen in sister project https://github.com/hurzelpurzel/sapgw-sample
Property | Optional | Comment |
---|---|---|
connectionProperties |
no |
Path to directory where sap-connection.properties can be found. |
namePattern |
no |
Comma seperated list uf bapis or a Pattern containing * to apply for search of Function Modules of interest |
maxResult |
yes |
Maximal ammount of Function module to be generated. Default is 20 |
javaPackage |
no |
Base Package of generated Sources |
outputDir |
no |
Folder to use for generated Java classes |
To use this plugin, you must add it as a plugin in the pom.xml and configure it.
<plugin>
<groupId>org.hibersap</groupId>
<artifactId>generator</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>generateSapEntities</id>
<phase>generate-sources</phase>
<configuration>
<connectionProperties>${project.basedir}/../</connectionProperties>
<namePattern>Z*</namePattern>
<javaPackage>net.atos.gw.hibersap.model</javaPackage>
<outputDir>${pom.basedir}/target/generated-sources/</outputDir>
</configuration>
<goals>
<goal>generateSapEntities</goal>
</goals>
</execution>
</executions>
</plugin>