• maven 项目linux运行可执行jar


    • 可运行jar 打包插件
        <build>
            <finalName>project_name</finalName>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <!-- 资源根目录排除各环境的配置,使用单独的资源目录来指定 -->
                    <excludes>
                        <exclude>dev/**</exclude>
                        <exclude>test/**</exclude>
                        <exclude>dev2/**</exclude>
                        <exclude>pro/**</exclude>
                    </excludes>
                </resource>
                <resource>
                    <directory>src/main/resources/${profiles.active}</directory>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptorRefs>
                            <descriptorRef>jar-with-dependencies</descriptorRef>
                        </descriptorRefs>
                        <!-- <useProjectArtifact>false</useProjectArtifact> -->
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.2</version>
                    <!-- <executions> <execution> <phase>package</phase> <goals> <goal>test-jar</goal>
                        </goals> </execution> </executions> -->
                </plugin>
            </plugins>
        </build>
    • linux 执行main 方法 不带参
    nohup java -cp project-jar-with-dependencies.jar com.zxwa.ntmss.img2text.NtmssV3LicenceImgProcesser >licenceImg.log &
    • linux 执行main 方法带参数..
    nohup java -cp project-jar-with-dependencies.jar com.zxwa.ntmss.img2text.NtmssV3LicenceImgProcesser param1 param2 >licenceImg.log &
    故乡明
  • 相关阅读:
    js解析与序列化json数据(三)
    flex与js通信
    js解析与序列化json数据(一)
    js自定义事件(二)
    js解析与序列化json数据(二)
    js自定义事件(一)
    用户详情接口
    积分转让二维码url接口
    组合模式 The Composite Pattern
    计算机系统中的整数运算
  • 原文地址:https://www.cnblogs.com/luweiweicode/p/14072851.html
Copyright © 2020-2023  润新知