Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: java
-
Labels:None
-
Number of attachments :
Description
Often the exec plugin is used to test standalone executable jar files, packaged by the maven-jar-plugin. A jar is configured to be executable by adding the following configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
...
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>fully.qualified.MainClass</mainClass>
</manifest>
</archive>
</configuration>
...
</plugin>
(from http://maven.apache.org/shared/maven-archiver/examples/classpath.html#Make)
It is annoying that one must add the same main class another time to be able to execute it by the maven exec plugin.
I want to propose that the maven exec plugin checks for the above configuration to learn about the executable class in case no maven exec plugin specific configuration is found. This would make poms smaller and reduces failure by redundancy.