Mavenのアセンブリのカスタムパッケージング規則をプラグイン

アセンブリ内のプラグインの導入

<plugin>
	<groupId>
		org.apache.maven.plugins
	</groupId>
	<artifactId>
		maven-assembly-plugin
	</artifactId>
	<configuration>
		<descriptors>
			<descriptor>
				src/assembly/src.xml
			</descriptor>
		</descriptors>
	</configuration>
	<executions>
		<execution>
			<phase>
				package
			</phase>
			<goals>
				<goal>
					single
				</goal>
			</goals>
		</execution>
	</executions>
</plugin>

プロフィールsrc.xml包装方針

<assembly>
    <id>${assembly-id}</id>
    <!-- 打包成文件夹 -->
    <formats>
        <format>dir</format>
    </formats>
	<includeBaseDirectory>
	false
	</includeBaseDirectory>
	<!--将依赖打包到 lib 目录下-->
    <dependencySets>
    	<dependency>
    		<outputDirectory>
    		lib
    		</outputDirectory>
    		<!--依赖的作用域-->
    		<scope>
    		compile
    		</scope>
    	</dependency>
    </dependencySets>
</assembly>

アセンブリ

公開された41元の記事 ウォンの賞賛0 ビュー783

おすすめ

転載: blog.csdn.net/weixin_37562241/article/details/104671486