If you don't know how to use JMeter Plugins API the easiest way would be going for Maven Exec plugin, this way you will be able to execute JMeterPluginsCMD Command Line Tool with necessary parameters in arbitrary phase of Maven Build Lifecycle
Example pom.xml file would look like:
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jmeter-maven</groupId>
<artifactId>com.example.jmeter-maven</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.7.0</version>
<configuration>
<jmeterExtensions>
<artifact>kg.apc:jmeter-plugins-cmd:2.1</artifact>
<artifact>kg.apc:cmdrunner:2.2.1</artifact>
<artifact>kg.apc:jmeter-plugins-cmn-jmeter:0.6</artifact>
<artifact>kg.apc:jmeter-plugins-graphs-basic:2.0</artifact>
<artifact>kg.apc:jmeter-plugins-synthesis:2.1</artifact>
<artifact>kg.apc:jmeter-plugins-filterresults:2.1</artifact>
</jmeterExtensions>
<downloadExtensionDependencies>false</downloadExtensionDependencies>
</configuration>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
<execution>
<id>jmeter-check-results</id>
<goals>
<goal>results</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>copy-cmdrunner-to-lib-folder</id>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<basedir>${basedir}/target/jmeter/lib/ext</basedir>
<executable>cp</executable>
<commandlineArgs>cmdrunner-2.2.1.jar ..</commandlineArgs>
</configuration>
</execution>
<execution>
<id>generate-aggregate-report</id>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<basedir>${basedir}/target/jmeter/lib</basedir>
<executable>java</executable>
<commandlineArgs>-jar cmdrunner-2.2.1.jar --tool Reporter --generate-csv ${basedir}/target/aggregate.csv --input-jtl ${basedir}/target/jmeter/results/${timestamp}-test.csv --plugin-type AggregateReport</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
It will produce aggregate.csv
file in target folder which will contain textual representation of the Aggregate Report data
For non-Maven executions you can install the required plugins using JMeter Plugins Manager