Fix fat JAR generation
* Replace Maven Assembly Plugin with Maven Shade Plugin * Extract main method to separate Main class
This commit is contained in:
		
							
								
								
									
										21
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								pom.xml
									
									
									
									
									
								
							@@ -61,23 +61,22 @@
 | 
			
		||||
		<plugins>
 | 
			
		||||
			<plugin>
 | 
			
		||||
				<groupId>org.apache.maven.plugins</groupId>
 | 
			
		||||
				<artifactId>maven-assembly-plugin</artifactId>
 | 
			
		||||
				<version>3.2.0</version>
 | 
			
		||||
				<artifactId>maven-shade-plugin</artifactId>
 | 
			
		||||
				<version>3.2.4</version>
 | 
			
		||||
				<executions>
 | 
			
		||||
					<execution>
 | 
			
		||||
						<phase>package</phase>
 | 
			
		||||
						<goals>
 | 
			
		||||
							<goal>single</goal>
 | 
			
		||||
							<goal>shade</goal>
 | 
			
		||||
						</goals>
 | 
			
		||||
						<configuration>
 | 
			
		||||
							<archive>
 | 
			
		||||
								<manifest>
 | 
			
		||||
									<mainClass>envoy.client.ui.Startup</mainClass>
 | 
			
		||||
								</manifest>
 | 
			
		||||
							</archive>
 | 
			
		||||
							<descriptorRefs>
 | 
			
		||||
								<descriptorRef>jar-with-dependencies</descriptorRef>
 | 
			
		||||
							</descriptorRefs>
 | 
			
		||||
							<shadedArtifactAttached>true</shadedArtifactAttached>
 | 
			
		||||
							<sharedClassifierName>envoy</sharedClassifierName>
 | 
			
		||||
							<transformers>
 | 
			
		||||
								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
 | 
			
		||||
									<mainClass>envoy.client.Main</mainClass>
 | 
			
		||||
								</transformer>
 | 
			
		||||
							</transformers>
 | 
			
		||||
						</configuration>
 | 
			
		||||
					</execution>
 | 
			
		||||
				</executions>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								src/main/java/envoy/client/Main.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								src/main/java/envoy/client/Main.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
package envoy.client;
 | 
			
		||||
 | 
			
		||||
import javafx.application.Application;
 | 
			
		||||
 | 
			
		||||
import envoy.client.ui.Startup;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Triggers application startup.
 | 
			
		||||
 * <p>
 | 
			
		||||
 * To allow Maven shading, the main method has to be separated from the
 | 
			
		||||
 * {@link Startup} class which extends {@link Application}.
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Project: <strong>envoy-client</strong><br>
 | 
			
		||||
 * File: <strong>Main.java</strong><br>
 | 
			
		||||
 * Created: <strong>05.07.2020</strong><br>
 | 
			
		||||
 *
 | 
			
		||||
 * @author Kai S. K. Engelbart
 | 
			
		||||
 * @since Envoy Client v0.1-beta
 | 
			
		||||
 */
 | 
			
		||||
public class Main {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Starts the application.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param args the command line arguments are processed by the
 | 
			
		||||
	 *             client configuration
 | 
			
		||||
	 * @since Envoy Client v0.1-beta
 | 
			
		||||
	 */
 | 
			
		||||
	public static void main(String[] args) { Application.launch(Startup.class, args); }
 | 
			
		||||
}
 | 
			
		||||
@@ -128,13 +128,4 @@ public final class Startup extends Application {
 | 
			
		||||
			logger.log(Level.SEVERE, "Unable to save local files: ", e);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Starts the application.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param args the command line arguments are processed by the
 | 
			
		||||
	 *             {@link ClientConfig}
 | 
			
		||||
	 * @since Envoy Client v0.1-beta
 | 
			
		||||
	 */
 | 
			
		||||
	public static void main(String[] args) { launch(args); }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user