You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Casey <ca...@gmail.com> on 2007/05/11 18:54:03 UTC

Re: [m2] Assembly Plugin

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 <be...@benshort.co.uk> wrote:
>
> On 4/26/07, John Casey <ca...@gmail.com> 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 <ja...@gmail.com> 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: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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

Re: [m2] Assembly Plugin

Posted by ben short <be...@benshort.co.uk>.
Thanks for the replies, I'll give it ago first thing Monday.

On 5/11/07, Matt Brozowski <br...@opennms.org> wrote:
>
> On May 11, 2007, at 12:54 PM, John Casey wrote:
>
> > Sorry it took me so long to respond, the email got buried... :(
> > 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.
> >
> You should be able to remove the '.dir' extension by using
>
>   <appendAssemblyId>false</appendAssemblyId>
>
> as part of you configuration.
>
> Matt
> ________________________________________________________________________
> ___
> Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
> The OpenNMS Group, Inc. Fax: +1 503 961 7746
> Email: brozow@opennms.org URL: http://www.opennms.com
>
>
>

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


Gatekeeper is the newest Apache Maven repository manager.

Posted by Aaron Metzger <am...@silkspeed.com>.
> Gatekeeper is the newest Apache Maven repository manager.

Please throw us a bone ;)

Days, weeks, months away ???

will it be open source?

Will it be full featured right out of the gate?

Will it support SSH and/or some other security mechanisms for 
distributed private enterprise use?

--
Sincerely,
Frozen in Anticipation





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


Re: [m2] Assembly Plugin

Posted by Matt Brozowski <br...@opennms.org>.
On May 11, 2007, at 12:54 PM, John Casey wrote:

> Sorry it took me so long to respond, the email got buried... :(
> 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.
>
You should be able to remove the '.dir' extension by using

  <appendAssemblyId>false</appendAssemblyId>

as part of you configuration.

Matt
________________________________________________________________________ 
___
Matt Brozowski, OpenNMS Maintainer Main: +1 919 812 4984
The OpenNMS Group, Inc. Fax: +1 503 961 7746
Email: brozow@opennms.org URL: http://www.opennms.com