I'm trying to move a project into maven but I need to provide a
deployment to our integration environment with a directory structure
that matches the legacy build.  I've been trying to use the assembly
plugin, and it's almost there, but I've got an extra layer of
directories that I need to get rid of.  Right now I would just like to
get the artifacts copied into a lib directory like this...

product
   lib
     moduleA.jar
     moduleB.jar

But I'm getting something like this

product
  lib
    product-1.1-SNAPSHOT-bin
      moduleA.jar
      moduleB.jar

I would just liket to get rid of that 'product-1.1-SNAPSHOT-bin'
directory.  I'm starting from a standard multi-module structure

parent
  moduleA
  moduleB
  product

and using the assembly plugin pretty much right out of the tutorial
(http://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html)

parent pom.xml has this entry in the build descriptor

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/bin.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>

The 'product' release pom.xml has this in it

    <build>
      <directory>lib</directory>
     ...
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
             <id>product-assembly</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
             </goals>
             <configuration>
               <descriptors>
                 <descriptor>src/assembly/bin.xml</descriptor>
               </descriptors>
             </configuration>
           </execution>
         </executions>
       </plugin>
    ...
    </build>

and the bin.xml file looks like

<assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd";>
  <id>bin</id>
  <formats>
    <format>dir</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <moduleSets>
    <moduleSet>

      <!-- Enable access to all projects in the current multimodule build! -->
      <useAllReactorProjects>true</useAllReactorProjects>

      <!-- Now, select which projects to include in this module-set. -->
      <includes>
        <include>org.my.examples:moduleA</include>
        <include>org.my.examples:moduleB</include>
      </includes>
      <binaries>
        <unpack>false</unpack>
      </binaries>
    </moduleSet>
  </moduleSets>
</assembly>

How can I specify that it should not create this intermediate
directory?  Or am I approaching this incorrectly?  I've been finding
that with maven, when things are hard I've usually got the wrong
approach.

Thanks in advance for your help

-pc

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to