maven-runnable-jar-including-dependencies
shift + alt + x (brings up popup with run options) => m = maven
OR Window -> Preferences -> General -> Keys (sort by Binding to see what's already defined)
search filter "maven" -> Run Maven Clean => f9
Running Control + F11 will fail as there is no executable for Eclipse to run
java.lang.NoClassDefFoundError: com/oxygencloud/sdk/util/MyMain
Caused by: java.lang.ClassNotFoundException: com.oxygencloud.sdk.util.MyMain
search filter "maven" -> (copy command "Run Maven Build") -> Run Maven Build => f10
(VERIFY IN Run As -> Run Configurations -> Maven Build -> getoxygensession exists with goal package)
NOW, the secret hotkey combo is: F9 -> F10 -> Control + F11
MAKE SURE YOU CAREFULLY CONTROL YOUR PACKAGES AND ACCESS MODIFIERS FOR YOUR DEPENDENCIES
package com.oxygencloud.sdk.util;
public class MyMain
{
public static void main( String[] args )
{
System.out.println( "MyMain" );
}
}
<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>com.oxygencloud.sdk.util</groupId>
<artifactId>getoxygensession</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>getoxygensession</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oxygencloud.sdk.util</groupId>
<artifactId>OxygenLogin</artifactId>
<version>0.15-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.7.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.oxygencloud.sdk.util.MyMain</Main-Class>
<Build-Number>123</Build-Number>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>