You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adrian Shum <tc...@taifook.com> on 2008/11/06 05:19:47 UTC

Multi-Module Assembly causing build twice

Dear all,
 
I am using Maven 2.0.9.  I am trying to create a multi-module assembly 
by having assembly descriptor in my multi-module project.
 
<assembly>
  <id>buildsvr</id>
  <formats>
    <format>dir</format>
  </formats>
  <moduleSets>
    <moduleSet>
      <includes>
        <include>foo:foo-app-ear</include>
        <include>foo:foo-bar-web</include>
        <incldue>foo:foo-another-jar</incldue>
      </includes>
      <binaries>
        <outputDirectory>modules/${artifactId}</outputDirectory>
        <includeDependencies>false</includeDependencies>
        <unpack>false</unpack>
      </binaries>
    </moduleSet>
  </moduleSets>
</assembly>
 
In my POM:
    <profiles>
        <profile>
            <id>mss.buildSvrOutput</id>
            <activation>
                <property>
                    <name>buildSvrOutputDir</name>
                </property>
            </activation>
 
            <build>
                <plugins>
                  <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
 
<outputDirectory>${buildSvrOutputDir}</outputDirectory>
                      <descriptors>
 
<descriptor>src/main/assembly/buildSvrOutputAssembly.xml</descriptor>
                      </descriptors>
                    </configuration>
                    <executions>
                      <execution>
                        <id>make-assembly</id> <!-- this is used for
inheritance merges -->
                        <phase>package</phase> <!-- append to the
packaging phase. -->
                        <goals>
                          <goal>assembly</goal> <!-- goals == mojos -->
                        </goals>
                      </execution>
                    </executions>
                    
                  </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
 
What I am trying to do is I want to put artifiacts to be deployed to our
app server
in a dedicate directory.
 
However, when I try to build my project by mvn clean install, mvn clean
package, 
mvn clean install package or even mvn clean install assembly:assembly,
it is found
that modules in my project is built twice.  It seems that one is
triggered by normal
build lifecycle, another one is triggered by the assembly plugin. Is
that a normal 
behavior of assembly?  Or did I do something wrong?
 
Thanks
 
Adrian
 
 


This email is confidential. If you are not the intended recipient, please delete it from your system and notify the sender immediately. Any unauthorized use, disclosure, dissemination or copying of this email is prohibited. Taifook Securities Group, its group companies and their content providers ("Parties") shall not be responsible for the accuracy or completeness of this email or its attachment, if any, which could contain virus, be corrupted, destroyed, incomplete, intercepted, lost or arrive late.   The Parties do not accept liability for any damage caused by this email.



Re: Multi-Module Assembly causing build twice

Posted by WAJSBERG Julien RD-BIZZ <ju...@orange-ftgroup.com>.
Adrian Shum a écrit :
> Dear all,
>  
> I am using Maven 2.0.9.  I am trying to create a multi-module assembly 
> by having assembly descriptor in my multi-module project.
>  
> ...

>  
> What I am trying to do is I want to put artifiacts to be deployed to our
> app server
> in a dedicate directory.
>  
> However, when I try to build my project by mvn clean install, mvn clean
> package, 
> mvn clean install package or even mvn clean install assembly:assembly,
> it is found
> that modules in my project is built twice.  It seems that one is
> triggered by normal
> build lifecycle, another one is triggered by the assembly plugin. Is
> that a normal 
> behavior of assembly?  Or did I do something wrong?
>   

Hi,

It is written in the documentation that the "assembly" goal triggers a
new build, and is meant to be called directly with "mvn assembly:assembly".
You should try either "attached" (that is meant to be part of the
lifecycle) or maybe "single" (although I don't understand very well what
this goal is about ;-) )

-- 
Julien

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