响应式网站开发源码,设计logo网站生成器,cms网站模板套用教程,如何将网站排名做高maven-source-plugin 作用#xff1a; 在构建过程中将项目的源代码进行打包#xff0c;并作为一个jar文件附着在主构件上#xff0c;在 pom.xml 中添加如下内容#xff0c;使用 maven 生成 jar 的同时生成 sources 包 在 pom 中配置如下#xff1a;
buildp… maven-source-plugin 作用 在构建过程中将项目的源代码进行打包并作为一个jar文件附着在主构件上在 pom.xml 中添加如下内容使用 maven 生成 jar 的同时生成 sources 包 在 pom 中配置如下
buildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactIdversion3.2.0/version
!-- 绑定source插件到Maven的生命周期并在生命周期后执行绑定的source的goal --executionsexecution!-- 绑定source插件到Maven的生命周期 --idattach-sources/idphasepackage/phase!--在生命周期后执行绑定的source插件的goals --goalsgoaljar-no-fork/goal/goals/execution/executions/plugin/plugins
/buildphasepackage/phase 表示配置的插件在 Maven 构建的打包阶段执行maven-source-plugin 提供项目自动将源码打包并发布的功能在需要发布源码项目的 pom.xml 文件中添加即可
执行 mvn installmaven会自动将source install到repository
执行 mvn deploymaven会自动将source deploy到remote-repositorymvn source:jar单独打包源码
plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactIdexecutionsexecutionidattach-sources/idgoalsgoaljar/goal/goals/execution/executions
/plugin注意在多项目构建中将 source-plugin 置于顶层或 parent 的 pom 中并不会发挥作用须置于具体项目的pom中