You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Petr V." <gr...@yahoo.com> on 2007/04/18 18:19:40 UTC

WEIRD : mvn assembly is not adding my dependencies

Greetings All,

Okay here is an issue and I am not sure what am I doing wrong.

I had this in one my "sub" project pom

       <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <configuration>
            <descriptors>
              <descriptor>src/assemble/CPWebService-assembly.xml</descriptor>
            </descriptors>
          </configuration>
        </plugin>

and now problem is that if I issue mvn assemly:assembly from "main" project then it complains that descriptior could not be found because I guess main POM has no clue for that. So every time I have to go to sub project and issue assembly command there.

c:\main\mvn assembly:assembly
====> comapins that descriptor is not found 
[INFO] [assembly:assembly]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] No assembly descriptors found.
[INFO] ------------------------------------------------------------------------

Now if I move to sub project 

c:\main\sublevel1\sublevel2\mvn assembly:assembly
====> It works fine and I get my zip file

Now I don't wanna move to sub project to issue assembly command

so is it possible if I could issue mvn assembly:assembly from main project ???

If it is _NOT_ possible then I have already tried following.
 
Alternate try:

What I did that I moved the above assemby plugin to main POM and made change in <descriptor> tag to find the assemly file with respect to main project then I issued mvn assembly from main project and I had success and got zip file which included all files and filesets but it did not inlcude all dependenices in my and showed no error by the way. 

My assembly.xml contains (just a snippet)

<files>
     <file>
      <source>src/main/lib/windows-x86-32.dll</source>
      <outputDirectory>/bin</outputDirectory>
    </file>    
</files>

<dependencySets>
    <dependencySet>
      <unpack>false</unpack>
      <scope>runtime</scope>
      <outputDirectory>/lib</outputDirectory>
      <includes>
        <include>com.abc.cp:cps-core</include>
        <include>com.abc.cp:cps-authn</include>
        <include>com.abc.cp:cps-authz</include>
        <include>com.abc.cp:cps-inv</include>
        <include>com.abc.cp:cps-perf</include>
        <include>com.abc.cp:CPWebService</include>
        <include>org.springframework:spring</include>
        <include>org.hibernate:hibernate</include>
        <include>org.hibernate:hibernate-annotations</include>
        <include>commons-dbcp:commons-dbcp</include>
        <include>dom4j:dom4j</include>
        <include>javax.transaction:jta</include>
        <include>com.microsoft.jdbcdriver:sqljdbc</include>
        <include>commons-pool:commons-pool</include>
        <include>javax.persistence:persistence-api</include>
        <include>commons-collections:commons-collections</include>
        <include>cglib:cglib</include>
        <include>asm:asm</include>
        <include>antlr:antlr</include>
      </includes>
    </dependencySet>
  </dependencySets>

Ok so I am wondering why my dependencies are not including if I add assmebly plugin in main project while if I leave assembly plugin in sub project, they are added. I have almostly tried one whole day to make it work but no luck. Any help is appreciated.

Thanks,

Petr V.

P.S. I admit that my maven knowledge is based on fire fighting. When ever I face issue, I google and get things done and I am not proeprly trained in maven.

       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Re: WEIRD : mvn assembly is not adding my dependencies

Posted by "Petr V." <gr...@yahoo.com>.
Thanks John. you rock. I was able to add all dependencies but only one dependency was not added in my zip file. Guess which one ??? The jar file which was output of sub project :-(

So basically I put the snippet in my sub project pom and issued mvn assembly from main project. It went via and It included all the dependencies from assembly dependency list but still missed the one dependency that was asking to add the jar file of sub project pom. Any trick for that ???

I hope that I am able to convey the point. Thanks for your support.

Petr V.



John Casey <ca...@gmail.com> wrote: You might find it easier to bind the assembly construction to the main build
process, in the package phase (for example). To do this, you can use the
assembly:single mojo like this:



  maven-assembly-plugin
  2.2-beta-1

  
    
      assembly
      
package

      single
      
        
          src/assemble/CPWebService-assembly.xml
        
      
    
  



Now, when you fire off the build from the top-level like this:

mvn clean install

you'll see that the sub-project with the assembly plugin configuration will
go ahead and put the assembly together when everything is packaged up.
Incidentally, using the single mojo allows you to have multiple assemblies
in the same multi-module build.

HTH,

John

On 4/18/07, Petr V.  wrote:
>
> Greetings All,
>
> Okay here is an issue and I am not sure what am I doing wrong.
>
> I had this in one my "sub" project pom
>
>        

>           maven-assembly-plugin
>           
>             
>               src/assemble/CPWebService-assembly.xml
> 
>             
>           
>         

>
> and now problem is that if I issue mvn assemly:assembly from "main"
> project then it complains that descriptior could not be found because I
> guess main POM has no clue for that. So every time I have to go to sub
> project and issue assembly command there.
>
> c:\main\mvn assembly:assembly
> ====> comapins that descriptor is not found
> [INFO] [assembly:assembly]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] No assembly descriptors found.
> [INFO]
> ------------------------------------------------------------------------
>
> Now if I move to sub project
>
> c:\main\sublevel1\sublevel2\mvn assembly:assembly
> ====> It works fine and I get my zip file
>
> Now I don't wanna move to sub project to issue assembly command
>
> so is it possible if I could issue mvn assembly:assembly from main project
> ???
>
> If it is _NOT_ possible then I have already tried following.
>
> Alternate try:
>
> What I did that I moved the above assemby plugin to main POM and made
> change in  tag to find the assemly file with respect to main
> project then I issued mvn assembly from main project and I had success and
> got zip file which included all files and filesets but it did not inlcude
> all dependenices in my and showed no error by the way.
>
> My assembly.xml contains (just a snippet)
>
> 
>      
>       src/main/lib/windows-x86-32.dll
>       /bin
>     
> 
>
> 
>     
>       false
>       runtime
>       /lib
>       
>         com.abc.cp:cps-core
>         com.abc.cp:cps-authn
>         com.abc.cp:cps-authz
>         com.abc.cp:cps-inv
>         com.abc.cp:cps-perf
>         com.abc.cp:CPWebService
>         org.springframework:spring
>         org.hibernate:hibernate
>         org.hibernate:hibernate-annotations
>         commons-dbcp:commons-dbcp
>         dom4j:dom4j
>         javax.transaction:jta
>         com.microsoft.jdbcdriver:sqljdbc
>         commons-pool:commons-pool
>         javax.persistence:persistence-api
>         commons-collections:commons-collections
>         cglib:cglib
>         asm:asm
>         antlr:antlr
>       
>     
>   
>
> Ok so I am wondering why my dependencies are not including if I add
> assmebly plugin in main project while if I leave assembly plugin in sub
> project, they are added. I have almostly tried one whole day to make it work
> but no luck. Any help is appreciated.
>
> Thanks,
>
> Petr V.
>
> P.S. I admit that my maven knowledge is based on fire fighting. When ever
> I face issue, I google and get things done and I am not proeprly trained in
> maven.
>
>
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check outnew cars at Yahoo! Autos.


       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Re: WEIRD : mvn assembly is not adding my dependencies

Posted by John Casey <ca...@gmail.com>.
You might find it easier to bind the assembly construction to the main build
process, in the package phase (for example). To do this, you can use the
assembly:single mojo like this:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2-beta-1</version>

  <executions>
    <execution>
      <id>assembly</id>
      <phase>package</phase>
      <goals><goal>single</goal></goals>
      <configuration>
        <descriptors>
          <descriptor>src/assemble/CPWebService-assembly.xml</descriptor>
        </descriptors>
      </configuration>
    </execution>
  </executions>
</plugin>

Now, when you fire off the build from the top-level like this:

mvn clean install

you'll see that the sub-project with the assembly plugin configuration will
go ahead and put the assembly together when everything is packaged up.
Incidentally, using the single mojo allows you to have multiple assemblies
in the same multi-module build.

HTH,

John

On 4/18/07, Petr V. <gr...@yahoo.com> wrote:
>
> Greetings All,
>
> Okay here is an issue and I am not sure what am I doing wrong.
>
> I had this in one my "sub" project pom
>
>        <plugin>
>           <artifactId>maven-assembly-plugin</artifactId>
>           <configuration>
>             <descriptors>
>               <descriptor>src/assemble/CPWebService-assembly.xml
> </descriptor>
>             </descriptors>
>           </configuration>
>         </plugin>
>
> and now problem is that if I issue mvn assemly:assembly from "main"
> project then it complains that descriptior could not be found because I
> guess main POM has no clue for that. So every time I have to go to sub
> project and issue assembly command there.
>
> c:\main\mvn assembly:assembly
> ====> comapins that descriptor is not found
> [INFO] [assembly:assembly]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] No assembly descriptors found.
> [INFO]
> ------------------------------------------------------------------------
>
> Now if I move to sub project
>
> c:\main\sublevel1\sublevel2\mvn assembly:assembly
> ====> It works fine and I get my zip file
>
> Now I don't wanna move to sub project to issue assembly command
>
> so is it possible if I could issue mvn assembly:assembly from main project
> ???
>
> If it is _NOT_ possible then I have already tried following.
>
> Alternate try:
>
> What I did that I moved the above assemby plugin to main POM and made
> change in <descriptor> tag to find the assemly file with respect to main
> project then I issued mvn assembly from main project and I had success and
> got zip file which included all files and filesets but it did not inlcude
> all dependenices in my and showed no error by the way.
>
> My assembly.xml contains (just a snippet)
>
> <files>
>      <file>
>       <source>src/main/lib/windows-x86-32.dll</source>
>       <outputDirectory>/bin</outputDirectory>
>     </file>
> </files>
>
> <dependencySets>
>     <dependencySet>
>       <unpack>false</unpack>
>       <scope>runtime</scope>
>       <outputDirectory>/lib</outputDirectory>
>       <includes>
>         <include>com.abc.cp:cps-core</include>
>         <include>com.abc.cp:cps-authn</include>
>         <include>com.abc.cp:cps-authz</include>
>         <include>com.abc.cp:cps-inv</include>
>         <include>com.abc.cp:cps-perf</include>
>         <include>com.abc.cp:CPWebService</include>
>         <include>org.springframework:spring</include>
>         <include>org.hibernate:hibernate</include>
>         <include>org.hibernate:hibernate-annotations</include>
>         <include>commons-dbcp:commons-dbcp</include>
>         <include>dom4j:dom4j</include>
>         <include>javax.transaction:jta</include>
>         <include>com.microsoft.jdbcdriver:sqljdbc</include>
>         <include>commons-pool:commons-pool</include>
>         <include>javax.persistence:persistence-api</include>
>         <include>commons-collections:commons-collections</include>
>         <include>cglib:cglib</include>
>         <include>asm:asm</include>
>         <include>antlr:antlr</include>
>       </includes>
>     </dependencySet>
>   </dependencySets>
>
> Ok so I am wondering why my dependencies are not including if I add
> assmebly plugin in main project while if I leave assembly plugin in sub
> project, they are added. I have almostly tried one whole day to make it work
> but no luck. Any help is appreciated.
>
> Thanks,
>
> Petr V.
>
> P.S. I admit that my maven knowledge is based on fire fighting. When ever
> I face issue, I google and get things done and I am not proeprly trained in
> maven.
>
>
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check outnew cars at Yahoo! Autos.