利用maven-assembly-plugin插件 打包
利用maven-assembly-plugin插件 打包
张嘴吃药 发表于3个月前
利用maven-assembly-plugin插件 打包
  • 发表于 3个月前
  • 阅读 20
  • 收藏 0
  • 点赞 0
  • 评论 0

腾讯云 技术升级10大核心产品年终让利>>>   

<build>
       <finalName>ngbomc-${artifactId}-${version}</finalName>
       <sourceDirectory>src/main/java</sourceDirectory>
       <resources>
           <!--<resource>
               <directory>src/main/resources</directory>
               <targetPath>${project.build.directory}</targetPath>
               <includes>
                   <include>**/*.xml</include>
                   <include>**/*.properties</include>
               </includes>
           </resource>-->
       </resources>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <configuration>
                   <skip>true</skip>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <configuration>
                   <source>1.7</source>
                   <target>1.7</target>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-assembly-plugin</artifactId>
               <version>2.4.1</version>
               <configuration>
                   <appendAssemblyId>false</appendAssemblyId>
                   <descriptors>
                       <descriptor>src/main/assembly/assembly.xml</descriptor>
                   </descriptors>
               </configuration>
               <executions>
                   <execution>
                       <id>make-assembly</id>
                       <phase>package</phase>
                       <goals>
                           <goal>single</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>

       </plugins>
   </build>
<!--   <build>
       <plugins>
           <plugin>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-maven-plugin</artifactId>
           </plugin>
       </plugins>
       &lt;!&ndash; 配置java版本 不配置的话默认父类配置的是1.6&ndash;&gt;
       <pluginManagement>
           <plugins>
               <plugin>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <configuration>
                       <source>1.7</source>
                       <target>1.7</target>
                   </configuration>
               </plugin>
           </plugins>
       </pluginManagement>
   </build>-->

 

<assembly>
    <id>bin</id>
    <formats>
        <format>tar</format>
    </formats>
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>true</useProjectArtifact>
            <outputDirectory>lib</outputDirectory>
            <scope>runtime</scope>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}/src/main/resources</directory>
            <outputDirectory>/conf</outputDirectory>
            <includes>
               <!-- <include>**/*</include>
                <include>*</include>-->
                <include>*.properties</include>
                <include>*.xml</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>lib</directory>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>*</include>
            </includes>
        </fileSet>
        <fileSet>
            <fileMode>755</fileMode>
            <directory>${project.basedir}/src/main/scripts</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>startup.sh</include>
                <include>shutdown.sh</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>

 

 

共有 人打赏支持
粉丝 0
博文 10
码字总数 2121
×
张嘴吃药
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: