You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Prescott <mp...@exchangesolutions.com> on 2008/05/29 22:22:53 UTC

Primary artifact: jar up some files, custom extension

I have a series of projects that have the same, very simple behavior: I
want the main artifact to simply jar up the source tree, but to have a
custom extension (e.g. .foo instead of .jar or .zip).
 
What's the right way to go about this?  Producing a plugin seems like
overkill for such a trivial requirement, but I'm not having much luck
with the assembly plugin that sonatype recommends (I can't seem to
control the extension).
 
Specifically, I can't seem to control the extension of the assembly; it
always comes out as the format (e.g. .jar).
<appendAssemblyId>false</appendAssemblyId> doesn't seem to do it either.
 
My pom's build section looks like this:
 
 <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2-beta-2</version>
        <executions>
          <execution>
            <id>create-foo</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <finalName>finalName.foo</finalName>
              <appendAssemblyId>false</appendAssemblyId>
              <descriptor>foo-assembly-descriptor.xml</descriptor>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
 
The foo-assembly-descriptor.xml looks like this:
 
<assembly>
  <id>foo</id>
  <formats>
    <format>zip</format>
  </formats>
  <fileSets>
    <fileSet>
      <directory>src</directory>
      <useDefaultExcludes>true</useDefaultExcludes>
    </fileSet>
  </fileSets>
</assembly>
 
The resulting assembly is "finalName.foo.zip"; I'd like it to be
"finalName.foo".
 
Michael
 

Michael Prescott
direct: 416.646.7062

main: 416.646.7000 
fax: 416.646.7050 

Exchange Solutions Inc.
250 Yonge Street, 18th Floor
Toronto, ON M5B 2L7
www.exchangesolutions.com