You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Pankaj <pa...@rediffmail.com> on 2012/05/17 20:10:41 UTC

Maven Assembly plugin -Multi module project- source and javadoc not getting added to zip file

I've multi module project and using maven's assembly plugin to zip the
project's artifact.

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

When i build main module, it will produce 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've added assembly plugin under ModuleB pom file and I'm using ModuleSet
in assembly discriptor 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'm getting only A.jar and B.Jar under zip file. I'm not getting javadoc
and source in zip file. Is it downloading it from m2 repo,  i'm suspecting
if it does so, because sources and java doc wouldn't be there in maven repo.
How can i add all three artifact in a zip file ?

2) I want to add assembly plugin in my parent pom rather than in ModuleB's
pom but if i do so, i get an exception "Please ensure the package phase is
run before the assembly is generated". After googling, i found few suggetion
to add assembly as module. Is there any other way to handle this ?


--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Assembly-plugin-Multi-module-project-source-and-javadoc-not-getting-added-to-zip-file-tp5708932.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven Assembly plugin -Multi module project- source and javadoc not getting added to zip file

Posted by Pankaj <pa...@rediffmail.com>.
I used dependecySet to solve this problem and as walsmatt mentioned
correctly, we can use wildcard to add all binaries. 

<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>

This will add all binary artifacts of project. Posting here in case if
anybody runs into similar kind of issue, this might help.
Thanks walshmatt.

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Assembly-plugin-Multi-module-project-source-and-javadoc-not-getting-added-to-zip-file-tp5708932p5709447.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven Assembly plugin -Multi module project- source and javadoc not getting added to zip file

Posted by Matt Walsh <mw...@chartwelltechnology.com>.
Yeah. You need to read the documentation. The format is
"groupId:artifactId:type:version[:classifier]".

"Artifact coordinatess may be given in simple groupId:artifactId form,
or they may be fully qualified in the form
groupId:artifactId:type:version[:classifier]. Additionally, wildcards
can be used, as in *:maven-*."

So maybe groupA:A:jar:*:* ?

> -----Original Message-----
> From: Pankaj [mailto:pankajit03@rediffmail.com]
> Sent: Thursday, May 17, 2012 1:31 PM
> To: users@maven.apache.org
> Subject: RE: Maven Assembly plugin -Multi module project- source and
> javadoc not getting added to zip file
> 
> Thanks for your reply.
> 
> I'm still getting the same problem. Getting below warning
> 
> 
> [WARNING] The following patterns were never triggered in this artifact
> inclusion
>  filter:
> o  'groupA:A:jar:javadoc'
> o  'groupA:A:jar:source'
> where as artifact which has all classes is getting added.
> 
> Thanks
> Pankaj
> 
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-
> Assembly-plugin-Multi-module-project-source-and-javadoc-not-getting-
> added-to-zip-file-tp5708932p5708936.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


______________________________________________________________________
This message, including any attachments, is confidential and contains information intended only for the person(s) named above. Any other distribution, copying or disclosure is strictly prohibited. If you are not the intended recipient or have received this message in error, please notify us immediately by reply email and permanently delete the original transmission from all of your systems and hard drives, including any attachments, without making a copy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven Assembly plugin -Multi module project- source and javadoc not getting added to zip file

Posted by Pankaj <pa...@rediffmail.com>.
Thanks for your reply.

I'm still getting the same problem. Getting below warning


[WARNING] The following patterns were never triggered in this artifact
inclusion
 filter:
o  'groupA:A:jar:javadoc'
o  'groupA:A:jar:source'
where as artifact which has all classes is getting added.

Thanks
Pankaj


--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Assembly-plugin-Multi-module-project-source-and-javadoc-not-getting-added-to-zip-file-tp5708932p5708936.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Maven Assembly plugin -Multi module project- source and javadoc not getting added to zip file

Posted by Matt Walsh <mw...@chartwelltechnology.com>.
Pankaj,

The problem is in your includes. "javadoc" and "source" are classifiers,
not types. 

Try 
	groupA:A:jar:sources
	groupB:A:jar:javadoc

and so on.


Matt

> -----Original Message-----
> From: Pankaj [mailto:pankajit03@rediffmail.com]
> Sent: Thursday, May 17, 2012 12:11 PM
> To: users@maven.apache.org
> Subject: Maven Assembly plugin -Multi module project- source and
> javadoc not getting added to zip file
> 
> I've multi module project and using maven's assembly plugin to zip the
> project's artifact.
> 
>     Proj
>      +Module A
>        pom.xml
>      +Module B
>        pom.xml
>     pom.xml
> 
> When i build main module, it will produce 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've added assembly plugin under ModuleB pom file and I'm using
> ModuleSet
> in assembly discriptor 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'm getting only A.jar and B.Jar under zip file. I'm not getting
> javadoc
> and source in zip file. Is it downloading it from m2 repo,  i'm
> suspecting
> if it does so, because sources and java doc wouldn't be there in maven
> repo.
> How can i add all three artifact in a zip file ?
> 
> 2) I want to add assembly plugin in my parent pom rather than in
> ModuleB's
> pom but if i do so, i get an exception "Please ensure the package
phase
> is
> run before the assembly is generated". After googling, i found few
> suggetion
> to add assembly as module. Is there any other way to handle this ?
> 
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-
> Assembly-plugin-Multi-module-project-source-and-javadoc-not-getting-
> added-to-zip-file-tp5708932.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


______________________________________________________________________
This message, including any attachments, is confidential and contains information intended only for the person(s) named above. Any other distribution, copying or disclosure is strictly prohibited. If you are not the intended recipient or have received this message in error, please notify us immediately by reply email and permanently delete the original transmission from all of your systems and hard drives, including any attachments, without making a copy.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org