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. <[EMAIL PROTECTED]> 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.

Reply via email to