Thanks for your help. I kept seeing the assembly file referenced, but
nothing too much on where it should be.
Here's my Assembly file:
assembly>
<id>bin</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>${artifactId}-${version}</baseDirectory>
<includeSiteDirectory>false</includeSiteDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
<lineEnding>lf</lineEnding>
<fileMode>0755</fileMode>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/conf</directory>
<outputDirectory>conf</outputDirectory>
<lineEnding>lf</lineEnding>
<fileMode>0644</fileMode>
<includes>
<include>**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Originally, I tried to create a src/main/instance directory, and any
files in that directory would be included in the root of the tar.gz
file. However, it kept putting them under src/main/conf/instance in
the tarball instead of in the root. I finally just defined two
separate filesets. I don't know if I need the <include>**</include>
line because this is the default, but it works.
There are two issues I am having:
1). In the tarball, the "lib" directory is owned by build/user, but
the bin and conf directory is owned by 0/0. Is there a way to set
this? I didn't see anything in the Assembly settings.
2). My boss wants to know why is the assembly file called bin.xml. I
told him because the assembly file is a "bin" type, and you name the
assembly file after the assembly type. He wants to see documentation
to this effect. Is there such documentation? I know you can call your
assembly file anything you want, but if this is the Maven standard, I
want to stick with it.
On Wed, Jan 28, 2009 at 8:47 AM, Karl Heinz Marbaise <[email protected]> wrote:
> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
--
David Weintraub
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]