xworker_startup

    Tool library for starting model applications.

Prerequisites

    The system needs to install Java and Maven, you can execute java and mvn in the console terminal normally.

Create a Maven project

    Find an empty directory and create a pom.xml file in this directory. The sample content of pom.xml is as follows.

<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>

    <artifactId>yourproject</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <groupId>org.xworker</groupId>

    <name>yourporjectname</name>
    <build>
        <plugins>
            <!-- Copy the dependent jar package to the lib directory -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                ${project.basedir}/lib/
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.xworker</groupId>
            <artifactId>xworker_startup</artifactId>
            <version>1.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.xworker</groupId>
            <artifactId>xworker_swt_thingeditor</artifactId>
            <version>1.4.5-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>sonatype</id>
            <name>sonatype Repository</name>
            <url>https://oss.sonatype.org/content/groups/public/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <layout>default</layout>
        </repository>
    </repositories>
</project>

    In the above pom.xml file, you can also introduce other dependencies as needed. What is introduced here is the startup and swt model editors.

Package the Maven project

    Execute the following command in the console.

mvn package

    If the execution is successful, you can see that a lib directory has been created in the current directory, and related dependencies have been copied to this directory.

Generate execution script

    When the mvn package command is successfully executed, you can execute the following command to create an execution script.

java -cp ./lib/xworker_startup-1.0.1-SNAPSHOT.jar xworker.startup.Startup ./ xworker.thingeditor.Setup run

    The following script files will be created based on the imported dependencies.

  • dml.cmd or dml.sh
    The script used to execute the model file.
     
  • swt.cmd or swt.sh
    After execution, the SWT version of the model editor will be launched.
     
  • web.cmd or web.sh
    After execution, the WEB version of the model editor will be launched. After execution, a URL address will be printed. Enter the address in the browser to enter the model editor. The initial user name and password are admin/admin.
     
  • javafx.cmd or javafx.sh
    Start the JavaFX version of the model editor.
     
  • setupenv.cmd or setupenv.sh
    Set the current dml.cmd or dml.sh as the system-level model runner. After execution, dml.cmd or dml.sh will generally be added to the system path, and the *.dml file will be associated with the current dml.cmd or dml.sh. If the association is successful, the *.dml file can be executed directly.

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号