配置pom
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.10</version>
<configuration>
<!-- 根目录 -->
<assembleDirectory>${project.build.directory}/analyzepotservice</assembleDirectory>
<!-- 打包的jar,以及maven依赖的jar放到这个目录里面 -->
<repositoryName>lib</repositoryName>
<!-- 可执行脚本的目录 -->
<binFolder>bin</binFolder>
<!-- 配置文件的目标目录 -->
<configurationDirectory>conf</configurationDirectory>
<!-- 拷贝配置文件到上面的目录中 -->
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<!-- 从哪里拷贝配置文件 (默认src/main/config) -->
<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
<!-- lib目录中jar的存放规则,默认是${groupId}/${artifactId}的目录格式,flat表示直接把jar放到lib目录 -->
<repositoryLayout>flat</repositoryLayout>
<encoding>UTF-8</encoding>
<logsDirectory>logs</logsDirectory>
<tempDirectory>tmp</tempDirectory>
<daemons>
<daemon>
<id>analyzeservice</id>
<!-- 配置启动类(需修改) -->
<mainClass>com.cloud.AnalyzeApplication</mainClass>
<platforms>
<platform>jsw</platform>
</platforms>
<generatorConfigurations>
<generatorConfiguration>
<generator>jsw</generator>
<includes>
<include>linux-x86-32</include>
<include>linux-x86-64</include>
<include>windows-x86-32</include>
<include>windows-x86-64</include>
</includes>
<configuration>
<property>
<name>configuration.directory.in.classpath.first</name>
<value>conf</value>
</property>
<property>
<name>wrapper.ping.timeout</name>
<value>120</value>
</property>
<property>
<name>set.default.REPO_DIR</name>
<value>lib</value>
</property>
<property>
<name>wrapper.logfile</name>
<value>logs/wrapper.log</value>
</property>
</configuration>
</generatorConfiguration>
</generatorConfigurations>
<jvmSettings>
<initialMemorySize>1024</initialMemorySize>
<maxMemorySize>2048</maxMemorySize>
<maxStackSize>128</maxStackSize>
</jvmSettings>
</daemon>
</daemons>
</configuration>
</plugin>
</plugins>
</build>
构建命令
mvn clean package appassembler:generate-daemons