-
-
What is the Assembly Plugin
Assembly aims to provide a plug-in project to rely on other file elements, modules, website and other documents stored in a single archive file.
# Assembly supported archive types
- zip
- tar.gz
- tar.bz2
- jar
- to you
- war
# Use steps
Here to SkyWalking probe packaged as
tar.gz
an example, ready to build Docker continuous integration is mirrored when late#POM
The
pom.xml
increase in plug-in configuration<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <executions> <!-- 配置执行器 --> <execution> <id>make-assembly</id> <!-- 绑定到 package 生命周期阶段上 --> <phase>package</phase> <goals> <!-- 只运行一次 --> <goal>single</goal> </goals> <configuration> <finalName>skywalking</finalName> <descriptors> <!-- 配置描述文件路径 --> <descriptor>src/main/resources/assembly.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> </plugins> </build>
#assembly.xml
Create a
src/main/resources/assembly.xml
profile<assembly> <id>6.0.0-Beta</id> <formats> <!-- 打包的文件格式,支持 zip、tar.gz、tar.bz2、jar、dir、war --> <format>tar.gz</format> </formats> <!-- tar.gz 压缩包下是否生成和项目名相同的根目录,有需要请设置成 true --> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <!-- 是否把本项目添加到依赖文件夹下,有需要请设置成 true --> <useProjectArtifact>false</useProjectArtifact> <outputDirectory>lib</outputDirectory> <!-- 将 scope 为 runtime 的依赖包打包 --> <scope>runtime</scope> </dependencySet> </dependencySets> <fileSets> <fileSet> <!-- 设置需要打包的文件路径 --> <directory>agent</directory> <!-- 打包后的输出路径 --> <outputDirectory></outputDirectory> </fileSet> </fileSets> </assembly>
# Packing
mvn clean package mvn clean install
- package: creates a directory named in the target
skywalking-6.0.0-Beta.tar.gz
compression package - install: creates a directory named in the local repository
hello-spring-cloud-external-skywalking-1.0.0-SNAPSHOT-6.0.0-Beta.tar.gz
compressed package
-
Attached: Maven Assembly plugin
Guess you like
Origin www.cnblogs.com/snake107/p/11920877.html
Recommended
Ranking