dariol83 / ccsds

Open source Java implementation of publicly available CCSDS standards: SLE, TM/TC, AOS, Space Packets, COP-1, time formats, CFDP, Encapsulation Packets.
Apache License 2.0
96 stars 29 forks source link

deploy problem? #8

Closed nculijun closed 3 years ago

nculijun commented 3 years ago

I've tried packaging it as an executable JAR,But the jar has some problem.

dariol83 commented 3 years ago

Hi @nculijun,

Thank you for raising this issue. I would happily help if you could explain a little bit more in details the problem you are having:

Bear in mind that the jars are not intended to be executable jars out of the box, I am not sure I defined the manifest in the poms to generate executable jars...

Best regards, Dario

nculijun commented 3 years ago

Thank you very much,I tried to packaging the module:"eu.dariolucia.ccsds.sle.utlfx" . This issue may be related to JDK 11 and JFX compatibility. I solved the deployment problem in the following ways:

  1. Add a Main Class:
package eu.dariolucia.ccsds.sle.utlfx.application;
import javafx.application.Application;

public class AppStart {
    public static void main(String[] args) {

        Application.launch(SleFxTestTool.class,args);
    }
}
  1. Add the following to the POM file
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <outputDirectory>${project.build.directory}/libs</outputDirectory>
                    <excludeTransitive>false</excludeTransitive> 
                    <stripVersion>false</stripVersion>
                </configuration>

                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/install/libs</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>libs/</classpathPrefix>
                            <mainClass>eu.dariolucia.ccsds.sle.utlfx.application.AppStart</mainClass>
                        </manifest>
                    </archive>
                    <outputDirectory>${project.build.directory}/install</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
dariol83 commented 3 years ago

Thank you for this, I will probably update the pom files to have this done for all the UI-based applications!

dariol83 commented 3 years ago

Thank you so much to share this snippet! I integrated it into the code, and gave you credits on the Readme.MD files :)