Skip to content

Instantly share code, notes, and snippets.

@yangl
Last active April 16, 2020 02:53
Show Gist options
  • Save yangl/b73fd7311cff34ac8062d6c0987c1b0d to your computer and use it in GitHub Desktop.
Save yangl/b73fd7311cff34ac8062d6c0987c1b0d to your computer and use it in GitHub Desktop.
appassembler-maven-plugin打包,注意extraArgument一行只能配置一个参数,不然生成的shell会多加了个“” <configurationSourceDirectory>参数暂时没法配置多个目录或者排队某个目录 (比assembly.xml方便一点的是可以自动给生成启动脚本)详见http://www.mojohaus.org/appassembler/appassembler-maven-plugin/
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
<repositoryLayout>flat</repositoryLayout>
<configurationDirectory>conf</configurationDirectory>
<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<!--<logsDirectory>logs</logsDirectory>-->
<tempDirectory>tmp</tempDirectory>
<assembleDirectory>${project.build.directory}/${project.artifactId}</assembleDirectory>
<binFileExtensions>
<unix>.sh</unix>
</binFileExtensions>
<platforms>
<platform>unix</platform>
</platforms>
<repositoryName>lib</repositoryName>
<programs>
<program>
<mainClass>com.sf.edp.event.engine.main.EventEngineMain</mainClass>
<name>start</name>
<jvmSettings>
<extraArguments>
<extraArgument>-Xmx3G</extraArgument>
<extraArgument>-Xms3G</extraArgument>
<extraArgument>-XX:MaxMetaspaceSize=256M</extraArgument>
<extraArgument>-XX:MetaspaceSize=256M</extraArgument>
<extraArgument>-XX:+UseG1GC</extraArgument>
<extraArgument>-XX:MaxGCPauseMillis=100</extraArgument>
<extraArgument>-XX:+ParallelRefProcEnabled</extraArgument>
<extraArgument>-XX:ErrorFile=/app/log/hs_err_pid%p.log</extraArgument>
<extraArgument>-XX:HeapDumpPath=/app/log</extraArgument>
<extraArgument>-XX:+HeapDumpOnOutOfMemoryError</extraArgument>
</extraArguments>
</jvmSettings>
</program>
</programs>
</configuration>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment