I have a Maven pom that uses
. But actually, I don\'t want build the war-file, I just want all the dependent jars collect
The only way I can think of to do what you want is to set use pom packaging (or create a custom packaging) and bind the required goals from the war packaging to the relevant phases of the lifecycle. If you go for pom packaging you can use define the war:war execution in a profile to allow you to package it, but you'll need to use the build-helper-maven-plugin attach-artifact goal to attach the war to the pom.
Note with this approach if you want to use any other war-specific processing it may cause you problems.
The lifecycle bindings for war packaging are listed in the Introduction to The Build Lifecycle (see the "Default Lifecycle Bindings - Packaging ejb / ejb3 / jar / par / rar / war" section).
To bind the relevant plugin executions to the pom packaging you would do as follows:
maven-resources-plugin
process-resources
process-resources
resources
maven-compile-plugin
compile
compile
compile
maven-resources-plugin
process-test-resources
process-test-resources
testResources
maven-surefire-plugin
test
test
test