Hi David,

I'm building a JAR file that needs to be packaged with some shell
scripts and some configuration files. The shell scripts will be in a
"bin" directory, the configuration files will be in a "conf"
directory, and I'd like the jar in the "lib" directory with any of the
dependency jars mentioned in the POM.

I've read about Assemblies in Maven -- The Definitive Guide, but I am
a little confused about them. It looks like the Assembly is separate
from the POM. Is this true? If it is separate from the POM, where is
it suppose to live, and how does the POM refer to it?
It's correct that's outside the pom. It lives in src/main/assembly or something like this...(see http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)


I figure this is a pretty standard setup for a standalone JAR
application, but I haven't seen any examples of this particular setup.
e.g. the following is a bin.xml assembly discriptor:
May be you have to change the include and the exclude section a bit.

<assembly>
    <id>bin</id>
    <formats>
        <format>tar.gz</format>
        <format>zip</format>
    </formats>
    <baseDirectory>${artifactId}-${version}</baseDirectory>
    <includeSiteDirectory>false</includeSiteDirectory>
    <dependencySets>
        <dependencySet>
            <outputDirectory>lib</outputDirectory>
            <unpack>false</unpack>
            <scope>runtime</scope>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <filtered>true</filtered>
            <includes>
                <include>supose.cmd</include>
            </includes>
        </fileSet>
        <fileSet>
            <includes>
                <include>search-examples.txt</include>
            </includes>
            <excludes>
                <exclude>*.log</exclude>
                <exclude>bin/**</exclude>
                <exclude>build/**</exclude>
                <exclude>dist/**</exclude>
                <exclude>test-output/**</exclude>
                <exclude>**/target/**</exclude>
            </excludes>
        </fileSet>
    </fileSets>
</assembly>

Within the pom you have to put the following: There you can configure where to put the assembly descriptors...

  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>2.2-beta-3</version>
      <configuration>
        <descriptors>
          <descriptor>src/main/assembly/bin.xml</descriptor>
        </descriptors>
      </configuration>
      <executions>
         <execution>
           <phase>package</phase>
           <goals>
             <goal>single</goal>
           </goals>
         </execution>
      </executions>
 </plugin>

That will bin the creation of the packages to the package phase...


--
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

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

Reply via email to