maven 相关的依赖
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<!–lib下直接存放jar,没有路径文件夹(如com/apache),如果没有这个选项则放在lib下的jar包会被com/apache类似的多层文件夹包裹起来–>
<repositoryLayout>flat</repositoryLayout>
<configurationDirectory>conf</configurationDirectory>
<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<!–生成的项目的目录位置,这里的client是项目的名称,你可以根据你的需要自己随便命名–>
<assembleDirectory>${project.build.directory}/client</assembleDirectory>
<!–java启动参数–>
<extraJvmArguments>-Xms128m</extraJvmArguments>
<binFileExtensions>
<unix>.sh</unix>
</binFileExtensions>
<platforms>
<platform>windows</platform>
<platform>unix</platform>
</platforms>
<repositoryName>lib</repositoryName>
<programs>
<program>
<!–指定主类,脚本名。会生成shell/bat两种类型,也可用platforms指定运行平台–>
<mainClass>ff.com.shiyan.PhamJS</mainClass>
<!– 生成的脚本文件的名称,比如start.sh,你也可以根据你的需要命名成其他名字 –>
<name>start</name>
</program>
</programs>
</configuration>
</plugin>
</plugins>
</build>
maven 命令:mvn package appassembler:assemble