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 &
故乡明