美文网首页
appassembler 构建打包

appassembler 构建打包

作者: 百度不清 | 来源:发表于2020-03-26 08:28 被阅读0次

配置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

最终结构

生成产物目录.png

相关文章

网友评论

      本文标题:appassembler 构建打包

      本文链接:https://www.haomeiwen.com/subject/szllgctx.html