The maven assembly plugin moduleset sources instructions are not including any files and not matching the included modules

十年热恋 提交于 2019-12-04 23:13:46

If module_assembly doesn't have a child reference to your module, it's not counted as a module. Note the content here refers to children only: http://maven.apache.org/plugins/maven-assembly-plugin/advanced-module-set-topics.html

If you want to do this, you need to use a dependencySet rather than a moduleSet.

PS - Thank you for the bounty!

It worked for me using the following configuration:

  <includeSubModules>false</includeSubModules>
  <useAllReactorProjects>true</useAllReactorProjects>

I was just debugging the assembly plugin, because I have a similar problen, and I think that the problem is <useAllReactorProjects>true</useAllReactorProjects>. On top of that, there is also the tag <includeSubModules>, which is probably what you want.

<assembly>
  <id>bin</id>
  <formats>
    <format>zip</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <moduleSets>
    <moduleSet>
      <useAllReactorProjects>false</useAllReactorProjects><!-- Or just don't remove this line -->
      <includeSubModules>true>
...
    </moduleSet>
  </moduleSets>
</assembly

What you are trying does not work, since module_a is not a submodule of module_assembly.

Here are some ideas of what you can do:

  • Include the relevant files into the jar (maybe the source plugin helps) and use dependencySet.
  • Change your module structure, such that module_assembly is the parent and module_parent and module_a are submodules. Of cource, the dependency structure remains as it is.
  • Just use a fileSet in the assembly with relative paths that point into the other project (ugly!)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!