I have a plugin that does just a copy but I haven't published it yet. If
you are interested, shoot me an email and I can send you the code or
binary if you prefer. It works like this:
<plugin>
<groupId>com.stchome.maven.mojo</groupId>
<artifactId>copy-dependancy</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</configuration>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
You specify something that would normally be a dependancy and it copies
it to the output directory (also configurable). It allows you to copy
something that you don't need on your classpath as a regular dependancy.
-----Original Message-----
From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 06, 2005 12:12 PM
To: Maven Users List
Subject: Re: [m2] assembly:directory problem (DirectoryMojo)
On Sun, 6 Nov 2005, Alexander Hars wrote:
This fixes your issue, but it's not meant for that - you now get all
files directly in the target/ dir without a common parent dir ( i think
).
Sounds like you want your plugins to run in the process-resources etc.
phase, and you're just abusing the assembly:directory mojo for copying
files. I think you're better off including some file copying or just
processing in your custom plugins. Lots of examples on how to copy files
in the other plugins.
-- Kenney
> Hi,
>
> The assembly:directory goal can be used to simply copy files and
> dependencies into some target directory without packing into a jar or
zip.
> This is useful when we have custom plugins that need to do some
> special processing on certain files/directories.
> However, in the current version of the DirectoryMojo the files can
> only be copied into a *version-dependent* subdirectory of the \target
directory.
> This happens, because DirectoryMojo is not aware when the
> <includeBaseDirectory> parameter is set to false.
>
> For example, if my artifact is
> <artifactId>myArtifact</artifactId>
> <version>1.0</version>,
>
> and my assembly.xml is something like:
>
> <assembly>
> <id>someId</id>
> ..
> <outputDirectory>/test</outputDirectory>
> ..
> </assembly>
>
> the resulting files will appear in:
> \target\myArtifact-1.0-someId\myArtifact-1.0\test\*.*
>
> This is unfortunate, because when the version changes, the directory
> to which the files are copied also changes. If we have some other
> plugins that do something with the files copied by assembly:directory,
> then they may not be aware of the directory change.
>
> Fortunately, the assembly plugin has an optional
> <includeBaseDirectory> parameter (defaults to true). This tag allows
> us to specify that we don't want to include the version-dependent base
directory.
>
> But if we set <includeBaseDirectory>false</includeBaseDirectory> the
> resulting files will still appear in:
> \target\my-Artifact-1.0-someId\test\*.*
>
> Thus currently there is no way to get the files to be copied to the
> version-independent directory:
> \target\test\*.*
>
> Fortunately, there is a simple way to change this: we just need to
> change 1 line in DirectoryMojo.java:
>
> /maven/components/trunk/maven-plugins/maven-assembly-plugin/src/main/j
> ava/org/apache/maven/plugin/assembly/DirectoryMojo.java
>
> Line 42
> - String fullName = finalName + "-" + assembly.getId();
> ----------------------------------------------------------------------
> --------------------------------------
> + String fullName = (assembly.isIncludeBaseDirectory() ?
> finalName + "-" + assembly.getId() : "");
>
> (The finalName is the ArtifactId+Version-Number)
>
> -Alexander
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]