Problem
The exec.main property is used in informaticspom to set the Main-Class in the JAR and assembly manifests, but it is not wired into the exec-maven-plugin's mainClass parameter. As a result, running mvn exec:java in a child project fails with:
The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:3.6.3:java are missing or invalid
Even when exec.main is correctly set in the child pom.xml, the exec plugin ignores it because the plugin's user property is exec.mainClass, not exec.main.
Expected behaviour
Setting <exec.main>com.example.Main</exec.main> in a child project should be sufficient to run mvn exec:java (and optionally mvn exec:java -Dexec.args="...") without any additional plugin configuration.
Suggested fix
Add an exec-maven-plugin configuration block in the parent POM's <build><plugins> section that maps the existing exec.main property to the plugin's mainClass parameter:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>${exec.main}</mainClass>
</configuration>
</plugin>
This is a non-breaking change: child projects that already override the exec plugin configuration are unaffected, and those that only set exec.main will start working as expected.
Problem
The
exec.mainproperty is used ininformaticspomto set theMain-Classin the JAR and assembly manifests, but it is not wired into theexec-maven-plugin'smainClassparameter. As a result, runningmvn exec:javain a child project fails with:Even when
exec.mainis correctly set in the childpom.xml, the exec plugin ignores it because the plugin's user property isexec.mainClass, notexec.main.Expected behaviour
Setting
<exec.main>com.example.Main</exec.main>in a child project should be sufficient to runmvn exec:java(and optionallymvn exec:java -Dexec.args="...") without any additional plugin configuration.Suggested fix
Add an
exec-maven-pluginconfiguration block in the parent POM's<build><plugins>section that maps the existingexec.mainproperty to the plugin'smainClassparameter:This is a non-breaking change: child projects that already override the exec plugin configuration are unaffected, and those that only set
exec.mainwill start working as expected.