Sorry it took me so long to respond, the email got buried... :(

If you add something like the following to your assembly plugin config in
your POM, you should be able to use target/debug.dir:

<build>
 <plugins>
   <plugin>
     <artifactId>maven-assembly-plugin</artifactId>
     <configuration>
       <descriptors>
         <descriptor>src/assembly/debug.xml</descriptor>
       </descriptors>
       <finalName>debug</finalName>
     </configuration>
     <executions>
       <execution>
         <id>debug</id>
         <phase>compile</phase>
         <goals>
           <goal>single</goal>
         </goals>
       </execution>
     </executions>
   </plugin>
 </plugins>
</build>

Notice two things about this:

1. I added a "finalName" configuration, which should result in the
target/debug.dir folder being created. Unfortunately, IIRC we cannot affect
the ".dir" extension, since the assembly plugin always appends the format
(read: extension) to the created assembly.

2. I changed the goal binding to "single". This works a little more smoothly
in multimodule builds, allowing other modules to build their own assemblies
if necessary.

Also, when I referred to configuring multiple assemblies in different
execution blocks, I'm talking about putting the "descriptors" and
"finalName" configurations into the <execution><configuration/> section,
rather than the top-level <plugin><configuration/>. This allows you to
specify multiple <execution/> sections, each with its own assembly
descriptor(s), phase bindings, etc.

I hope that helps.

-john

On 4/26/07, ben short <[EMAIL PROTECTED]> wrote:

On 4/26/07, John Casey <[EMAIL PROTECTED]> wrote:
> In your POM, you should configure the assembly plugin with the
following:
>
> <finalName>debug</finalName>
>
> Although I will say that this will only generate a 'target/debug.dir'
> directory, not a target/debug one...that's because the assembly format
is
> always appended to the directory/file name.
>
> ...oh, and if you're creating multiple types of assemblies, you may want
to
> stick that into an execution-level configuration block.
>
> BTW, I noticed the *.jar entry...are you trying to capture a
dependencySet
> with that? If so, you could use:
>
> <dependencySets>
>   <dependencySet>
>     <outputDirectory>libs</outputDirectory>
>   </dependencySet>
> </dependencySets>
>
> HTH,
>
> john
>
> On 4/26/07, ben short <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I'm trying to use the assembly plugin to create a directory in my
> > target Dir called debug. In this I'm going to put everything i need in
> > order to run the project in debug mode via my ide.
> >
> > Currently I have this assembly descriptor
> >
> > <assembly>
> >   <id>debug</id>
> >   <formats>
> >     <format>dir</format>
> >   </formats>
> >   <fileSets>
> >     <fileSet>
> >       <includes>
> >         <include>README*</include>
> >         <include>LICENSE*</include>
> >         <include>NOTICE*</include>
> >       </includes>
> >     </fileSet>
> >     <fileSet>
> >       <directory>target</directory>
> >       <outputDirectory>libs</outputDirectory>
> >       <includes>
> >         <include>*.jar</include>
> >       </includes>
> >     </fileSet>
> >   </fileSets>
> > </assembly>
> >
> > I think I understand how to include files etc, but i cant see how i
> > can tell it to create a directory called 'debug'. I always end up with
> > a target/artifactname-version-debug.dir/artifactname-version.
> > What I really want is target/debug. Is this even possible?
> >
> > Ben
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> John Casey
> ---
> Maven Developer (http://maven.apache.org)
> ---
> Blog: http://www.ejlife.net/blogs/buildchimp
>

John,

This is what i have so far....

pom.xml

<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                  <descriptors>
                    <descriptor>src/assembly/debug.xml</descriptor>
                  </descriptors>
                </configuration>
                <executions>
                  <execution>
                    <id>debug</id>
                    <phase>compile</phase>
                    <goals>
                      <goal>attached</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>

debug.xml

<assembly>
  <id>debug</id>
  <formats>
    <format>dir</format>
  </formats>
  <files>
      <file>
        <source>src/main/application_files/placeholder</source>
        <outputDirectory>database</outputDirectory>
      </file>
      <file>
        <source>src/main/application_files/placeholder</source>
        <outputDirectory>logs</outputDirectory>
      </file>
      <file>
        <source>src/main/application_files/logging.properties</source>
      </file>
      <file>
          <source>src/main/application_files/Tyrell.properties</source>
      </file>
  </files>
  <fileSets>
    <fileSet>
      <directory>target</directory>
      <outputDirectory>libraries</outputDirectory>
      <includes>
        <include>*.jar</include>
      </includes>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputDirectory>libraries</outputDirectory>
    </dependencySet>
  </dependencySets>
</assembly>

That all works well apart from the name. You said...

> ...oh, and if you're creating multiple types of assemblies, you may want
to
> stick that into an execution-level configuration block.

Im not sure where you mean, could you help me out please?

Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
John Casey
---
Maven Developer (http://maven.apache.org)
---
Blog: http://www.ejlife.net/blogs/buildchimp

Reply via email to