Maven build plugin -Multi-module and javadoc are not added to the zip file

I have a project with several modules and use the maven build plugin for a zip project artifact.

Proj
 +Module A
   pom.xml
 +Module B
   pom.xml
pom.xml

When I build the main module, it will produce the following things

Proj
 +Module A
   target\A.jar
   target\A-source.jar
   target\A-javadoc.jar
 +Module B
   target\B.jar
   target\B-source.jar
   target\B-javadoc.jar

1) I added the plugin collector in the moduleB pom file, and I use ModuleSet in the assembly descriptor file

<moduleSets>
    <moduleSet>
       <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>groupA:A:jar</include>
        <include>groupA:A:javadoc</include>
        <include>groupA:A:source</include>  
      </includes>
      <binaries>
        <outputDirectory>moduleA</outputDirectory>
        <unpack>false</unpack>
      </binaries>
    </moduleSet>

    <moduleSet>
    <useAllReactorProjects>true</useAllReactorProjects>
      <includes>
        <include>groupB:B:jar</include>
        <include>groupB:B:javadoc</include>
        <include>groupB:B:source</include>
      </includes>
      <binaries>
        <outputDirectory>moduleB</outputDirectory>
        <unpack>false</unpack>
      </binaries>
    </moduleSet>
  </moduleSets>

But I only get A.jar and B.Jar under the zip file. I do not get javadoc and source in zip file. Does he download it from m2 repo, I suspect if this is so, because the sources and java-doc will not be present in the maven reporee artifact. How can I add all three artifacts to a zip file?

2) pom, ModuleB pom, , ", , ". googling . ?

+3
1

dependecySet , .

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
  <id>bin</id>
  <includeBaseDirectory>false</includeBaseDirectory>
  <formats>
    <format>zip</format>
  </formats>
 <dependencySets>
        <dependencySet>
            <includes>
                <include>groupA:*:*:*</include>
            </includes>
            </dependencySet>
         </dependencySets>
</assembly>

. - , . . , - , .

+3

All Articles