-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Pavan Shankar Koli edited this page Sep 2, 2017
·
9 revisions
A plugin that helps generate pojo from data provided in excel sheet, to get started add the following in the plugin section of your pom:
<plugin>
<groupId>com.github.pkoli</groupId>
<artifactId>xls2pojo-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<fileName>target/classes/excel.xlsx</fileName>
</configuration>
<goals>
<goal>xls2pojo</goal>
</goals>
</execution>
</executions>
</plugin>
Where excel.xlsx is the name of the excel file containing the data.
The data required and the order in which the data must be present is as shown :
The first column contains the class name, the second one contains the variable name and the third one contains the data type.
On completing the build a java class would be generated in the generated-sources/xls2pojo folder. A Class.java file would be generated having a variable named variable of String data type.