zoukankan      html  css  js  c++  java
  • 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 &
    故乡明
  • 相关阅读:
    SQL 中 Left Join 转为 Inner Join 的实际应用
    结合 Mybatis,探讨 Oracle 中 in 与 not in 的陷阱
    一个“保存”按钮同时存在“增删改”三种操作,该如何去实现?
    边边角角
    NIPS2017-The neural hawks process
    第一届山东省ACM——Phone Number(java)
    第一届山东省ACM——Balloons(java)
    java 解 poj 1000
    poj Flip Game 1753 (枚举)
    ACM交流赛感悟
  • 原文地址:https://www.cnblogs.com/luweiweicode/p/14072851.html
Copyright © 2011-2022 走看看