views:

373

answers:

1

Hello,

For weeks, I've been wrestling with maven, getting it to deploy our project "properly."

I'm almost done but I have one stubborn little problem:

When I use the maven assembly plugin with the "directory" goal as in

mvn assembly:directory

I get LOTS of console output like the following:

[INFO] tomcat/conf already added, skipping
 [INFO] tomcat/conf/Catalina already added, skipping
 [INFO] tomcat/conf/Catalina/localhost already added, skipping
 [INFO] tomcat/webapps already added, skipping

I've written my own assembly descriptor that basically copies several FileSets into various sub-directories within our deploy directory. Messages like the ones above appear whenever a file from one FileSet is being copied to a location in which another FileSet has already created the basic directory structure (and some "default" files that can be overwritten).

So, I'm having a hard time figuring out:

How do I either 1) Suppress these messages (but only the "already added" messages) or 2) allow for overwrite?

A: 

Hi, if i understand your question correct you should use the maven-dependency plugin to copy files/overwrite instead of using the assembly plugin...

khmarbaise
Thanks for you response. The maven-dependency-plugin does not seem to be a good fit for my needs. In fact, I tried it a few weeks ago and, after digging in, I found that it's more geared toward copying artifacts (such as JUnit) than file sets. It seems the assembly:directory goal is the better choice for moving (assembling) sets of files into an output directory. From what I gather, the assembly plugin is for when you want to group things together in one place, typically for zipping. Right now, my only problem is I can't figure out how to suppress/avoid the "already added" messages.
gmale
Hm..the maven-dependency-plugin (http://maven.apache.org/plugins/maven-dependency-plugin/copy-mojo.html) seemed to be exactly what you need (it has overwrite options etc.)..copy artifacts (files) to a particular location...May be it would be a good idea to take a look at the maven-cargo-plugin (http://cargo.codehaus.org/Maven2+plugin), cause it can start/stop/deploy to tomcat etc. BTW: Which version of the assembly-plugin do you use? May be update to newest..
khmarbaise
This doesn't exactly solve my problem but I will accept your answer since I have no others. It's the thought that counts, right? lol
gmale
@gmale dont accept answers if they dont answer your question. I came in hopes to solve my problem. I am left disappointed :(
garbagecollector
@garbagecollector: sorry for your inconvenience. But the question went unanswered for 3 months. No one else even made an attempt. I feel it's only fair to give the guy credit for trying. After all, the answer "I accept" and "the correct answer" aren't necessarily the same thing. As a counter example, someone might correctly answer my question in an offensive way. It would be "the correct answer" but it wouldn't be the one I'd accept.
gmale
@gmale I disagree completely. a question is asked, the correct answer is the one that helped the user the most in solving the problem. If no one has looked at it for 3 months, put a bounty on it.
garbagecollector