jgvariant-tool: Add Maven exec plugin for direct execution.

Change-Id: I683100e55a9ba06028bc0d92af4087c5749ad4ad
diff --git a/README.md b/README.md
index 07558b0..962810b 100644
--- a/README.md
+++ b/README.md
@@ -89,13 +89,16 @@
 To build and run a shaded JAR:
 
     $ mvn package -pl jgvariant-tool -am -Pshade
-    $ java -jar /home/mulk/Arbeitskasten/jgvariant/jgvariant-tool/target/jgvariant-tool-*.jar
+    $ java -jar /home/mulk/Arbeitskasten/jgvariant/jgvariant-tool/target/jgvariant-tool-*.jar ...
 
 To build and run a native executable:
 
     $ mvn package -pl jgvariant-tool -am -Pnative
-    $ ./jgvariant-tool/target/jgvariant
+    $ ./jgvariant-tool/target/jgvariant ...
 
+You can also run the tool directly with Maven using the `exec` profile:
+
+    $ mvn verify -pl jgvariant-tool -am -Pexec -Dexec.args="..."
 
 ## Library installation
 
diff --git a/jgvariant-parent/pom.xml b/jgvariant-parent/pom.xml
index 4d053fc..0fadc4c 100644
--- a/jgvariant-parent/pom.xml
+++ b/jgvariant-parent/pom.xml
@@ -56,6 +56,7 @@
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
     <compiler-plugin.version>3.11.0</compiler-plugin.version>
+    <exec-plugin.version>3.1.0</exec-plugin.version>
     <failsafe-plugin.version>${surefire-plugin.version}</failsafe-plugin.version>
     <flatten-plugin.version>1.5.0</flatten-plugin.version>
     <jar-plugin.version>3.3.0</jar-plugin.version>
@@ -266,6 +267,12 @@
         </plugin>
 
         <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>exec-maven-plugin</artifactId>
+          <version>${exec-plugin.version}</version>
+        </plugin>
+
+        <plugin>
           <groupId>org.graalvm.buildtools</groupId>
           <artifactId>native-maven-plugin</artifactId>
           <version>${native-plugin.version}</version>
diff --git a/jgvariant-tool/pom.xml b/jgvariant-tool/pom.xml
index ee2b8a8..6e01ade 100644
--- a/jgvariant-tool/pom.xml
+++ b/jgvariant-tool/pom.xml
@@ -234,6 +234,30 @@
         </plugins>
       </build>
     </profile>
+
+    <profile>
+      <id>exec</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <phase>verify</phase>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>eu.mulk.jgvariant.tool.Main</mainClass>
+              <arguments/>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>