1. <?xml version="1.0" encoding="UTF-8"?>
    2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
    4. <build>
    5. <plugins>
    6. <plugin>
    7. <groupId>org.springframework.boot</groupId>
    8. <artifactId>spring-boot-maven-plugin</artifactId>
    9. <configuration>
    10. <mainClass>com.genew.ems.GponCMApplication</mainClass>
    11. </configuration>
    12. <executions>
    13. <execution>
    14. <goals>
    15. <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中 -->
    16. </goals>
    17. </execution>
    18. </executions>
    19. </plugin>
    20. <plugin>
    21. <artifactId>maven-resources-plugin</artifactId>
    22. <executions>
    23. <execution>
    24. <id>copy-bulid</id>
    25. <phase>package</phase>
    26. <goals>
    27. <goal>copy-resources</goal>
    28. </goals>
    29. <configuration>
    30. <encoding>UTF-8</encoding>
    31. <outputDirectory>
    32. ${boot-jar-output}/NuMax_Cloud_4000_${boot-jar-version}/Services/cmgpon-service/
    33. </outputDirectory>
    34. <resources>
    35. <resource>
    36. <directory>target</directory>
    37. <include>*.jar</include>
    38. <filtering>false</filtering>
    39. </resource>
    40. </resources>
    41. </configuration>
    42. </execution>
    43. </executions>
    44. </plugin>
    45. <plugin>
    46. <artifactId>maven-assembly-plugin</artifactId>
    47. <version>2.2.1</version>
    48. <configuration>
    49. <descriptors>
    50. <descriptor>src/main/assembly/assembly.xml</descriptor>
    51. </descriptors>
    52. </configuration>
    53. <executions>
    54. <execution>
    55. <id>make-assembly</id>
    56. <phase>package</phase>
    57. <goals>
    58. <goal>single</goal>
    59. </goals>
    60. </execution>
    61. </executions>
    62. </plugin>
    63. </plugins>
    64. </build>
    65. </project>
    66. <!-- assembly.xml -->
    67. <?xml version="1.0" encoding="UTF-8"?>
    68. <assembly>
    69. <id>distribution</id>
    70. <formats>
    71. <format>zip</format>
    72. </formats>
    73. <includeBaseDirectory>true</includeBaseDirectory>
    74. <fileSets>
    75. <fileSet>
    76. <directory>${boot-jar-output}/NuMax_Cloud_4000_${boot-jar-version}</directory>
    77. <outputDirectory>${boot-jar-output}</outputDirectory>
    78. <includes>
    79. <include>**/*</include>
    80. </includes>
    81. <fileMode>0755</fileMode>
    82. <!-- 在windows下执行,实际运行环境为Linux。 需要进行脚本文件转换 -->
    83. <lineEnding>unix</lineEnding>
    84. </fileSet>
    85. </fileSets>
    86. </assembly>
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd">
    
      <!--构建项目需要的信息 -->
        <build>
              <!--使用的插件列表 -->
            <plugins>
                <plugin>
                      <!--插件在仓库里的group ID -->
                        <groupId />
                        <!--插件在仓库里的artifact ID -->
                        <artifactId />
                        <!--被使用的插件的版本(或版本范围) -->
                        <version />
                        <!--是否从该插件下载Maven扩展(例如打包和类型处理器),由于性能原因,只有在真需要下载时,该元素才被设置成enabled -->
                        <extensions />
                        <!--在构建生命周期中执行一组目标的配置。每个目标可能有不同的配置。 -->
                        <executions>
                            <!--execution元素包含了插件执行需要的信息 -->
                            <execution>
                                <!--执行目标的标识符,用于标识构建过程中的目标,或者匹配继承过程中需要合并的执行目标 -->
                                <id />
                                <!--绑定了目标的构建生命周期阶段,如果省略,目标会被绑定到源数据里配置的默认阶段 -->
                                <phase />
                                <!--配置的执行目标 -->
                              <goals>
                                <!--可以把依赖包都打包到生成的Jar包中-->
                                <goal>repackage</goal>
                              </goals>
                                <!--配置是否被传播到子POM -->
                                <inherited />
                                <!--作为DOM对象的配置 -->
                              <configuration>
                                <!--可以生成不含依赖包的不可执行Jar包-->
                                <classifier>exec</classifier>
                              </configuration>
                            </execution>
                        </executions>
                        <!--项目引入插件所需要的额外依赖 -->
                        <dependencies>
                            <!--参见dependencies/dependency元素 -->
                            <dependency/>
                        </dependencies>
                        <!--任何配置是否被传播到子项目 -->
                        <inherited />
                        <!--作为DOM对象的配置 -->
                  <configuration>
                        <!--启动类-->
                        <mainClass/>
                        <!--可执行文件名称-->
                        <finalName/>
                  </configuration>
                </plugin>
            </plugins>
            <!--该元素设置了项目源码目录,当构建项目的时候,构建系统会编译目录里的源码。该路径是相对于pom.xml的相对路径。 -->
            <sourceDirectory />
            <!--该元素设置了项目脚本源码目录,该目录和源码目录不同:绝大多数情况下,该目录下的内容 会被拷贝到输出目录(因为脚本是被解释的,而不是被编译的)。 -->
            <scriptSourceDirectory />
            <!--该元素设置了项目单元测试使用的源码目录,当测试项目的时候,构建系统会编译目录里的源码。该路径是相对于pom.xml的相对路径。 -->
            <testSourceDirectory />
            <!--被编译过的应用程序class文件存放的目录。 -->
            <outputDirectory />
            <!--被编译过的测试class文件存放的目录。 -->
            <testOutputDirectory />
            <!--使用来自该项目的一系列构建扩展 -->
            <extensions>
                <!--描述使用到的构建扩展。 -->
                <extension>
                    <!--构建扩展的groupId -->
                    <groupId />
                    <!--构建扩展的artifactId -->
                    <artifactId />
                    <!--构建扩展的版本 -->
                    <version />
                </extension>
            </extensions>
            <!--当项目没有规定目标(Maven2 叫做阶段)时的默认值 -->
            <defaultGoal />
            <!--这个元素描述了项目相关的所有资源路径列表,例如和项目相关的属性文件,这些资源被包含在最终的打包文件里。 -->
            <resources>
                <!--这个元素描述了项目相关或测试相关的所有资源路径 -->
                <resource>
                    <!-- 描述了资源的目标路径。该路径相对target/classes目录(例如${project.build.outputDirectory})。举个例 
                        子,如果你想资源在特定的包里(org.apache.maven.messages),你就必须该元素设置为org/apache/maven /messages。然而,如果你只是想把资源放到源码目录结构里,就不需要该配置。 -->
                    <targetPath />
                    <!--是否使用参数值代替参数名。参数值取自properties元素或者文件里配置的属性,文件在filters元素里列出。 -->
                    <filtering />
                    <!--描述存放资源的目录,该路径相对POM路径 -->
                    <directory />
                    <!--包含的模式列表,例如**/*.xml. -->
                    <includes />
                    <!--排除的模式列表,例如**/*.xml -->
                    <excludes />
                </resource>
            </resources>
            <!--这个元素描述了单元测试相关的所有资源路径,例如和单元测试相关的属性文件。 -->
            <testResources>
                <!--这个元素描述了测试相关的所有资源路径,参见build/resources/resource元素的说明 -->
                <testResource>
                    <targetPath />
                    <filtering />
                    <directory />
                    <includes />
                    <excludes />
                </testResource>
            </testResources>
            <!--构建产生的所有文件存放的目录 -->
            <directory />
            <!--产生的构件的文件名,默认值是${artifactId}-${version}。 -->
            <finalName />
            <!--当filtering开关打开时,使用到的过滤器属性文件列表 -->
            <filters />
            <!--子项目可以引用的默认插件信息。该插件配置项直到被引用时才会被解析或绑定到生命周期。给定插件的任何本地配置都会覆盖这里的配置 -->
            <pluginManagement>
                <!--使用的插件列表 。 -->
                <plugins>
                    <!--plugin元素包含描述插件所需要的信息。 -->
                    <plugin>
                        <!--插件在仓库里的group ID -->
                        <groupId />
                        <!--插件在仓库里的artifact ID -->
                        <artifactId />
                        <!--被使用的插件的版本(或版本范围) -->
                        <version />
                        <!--是否从该插件下载Maven扩展(例如打包和类型处理器),由于性能原因,只有在真需要下载时,该元素才被设置成enabled。 -->
                        <extensions />
                        <!--在构建生命周期中执行一组目标的配置。每个目标可能有不同的配置。 -->
                        <executions>
                            <!--execution元素包含了插件执行需要的信息 -->
                            <execution>
                                <!--执行目标的标识符,用于标识构建过程中的目标,或者匹配继承过程中需要合并的执行目标 -->
                                <id />
                                <!--绑定了目标的构建生命周期阶段,如果省略,目标会被绑定到源数据里配置的默认阶段 -->
                                <phase />
                                <!--配置的执行目标 -->
                                <goals />
                                <!--配置是否被传播到子POM -->
                                <inherited />
                                <!--作为DOM对象的配置 -->
                                <configuration />
                            </execution>
                        </executions>
                        <!--项目引入插件所需要的额外依赖 -->
                        <dependencies>
                            <!--参见dependencies/dependency元素 -->
                            <dependency>
                                ......
                            </dependency>
                        </dependencies>
                        <!--任何配置是否被传播到子项目 -->
                        <inherited />
                        <!--作为DOM对象的配置 -->
                        <configuration />
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
    
        <!--描述了这个项目构建环境中的前提条件。 -->
        <prerequisites>
            <!--构建该项目或使用该插件所需要的Maven的最低版本 -->
            <maven />
        </prerequisites>
        <!--项目的问题管理系统(Bugzilla, Jira, Scarab,或任何你喜欢的问题管理系统)的名称和URL,本例为 jira -->
        <issueManagement>
            <!--问题管理系统(例如jira)的名字, -->
            <system>jira</system>
            <!--该项目使用的问题管理系统的URL -->
            <url>http://jira.baidu.com/banseon</url>
        </issueManagement>
    </project>