maven配置文件单独打zip包

maven配置文件单独打zip包

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
	 <executions>
              <execution>
                <id>make-assembly</id>
		<phase>package</phase>
                <goals>
		  <goal>single</goal>
		</goals>
                <configuration>
		  <finalName>${project.name}</finalName>
                  <descriptors>
			 <descriptor>src/main/resources/assembly.xml</descriptor>
                    </descriptors>
		</configuration>
	</execution>
</executions>
</plugin>

assembly.xml

<assembly>
    <id>assembly</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>true</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>src/main/resources/template</directory>
            <includes>
                <include>*</include>
            </includes>
            <outputDirectory>conf</outputDirectory>
        </fileSet>
    </fileSets>
</assembly>

会在target下打出zip包

容器启动完成的时候 实现接口ApplicationRunner即可

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » maven配置文件单独打zip包