views:

69

answers:

2

Why does maven download dependencies when I run mvn clean? can I turn that off?

+2  A: 

run as mvn -o clean

splix
+3  A: 

Why does maven download dependencies when I run mvn clean?

AFAIK, it doesn't, Maven doesn't perform a dependency resolution during clean (I just cross checked that and I confirm it doesn't, at least not with Maven 2.2.1 and the clean plugin 2.2). Having that said, it seems that attaching a plugin to the clean phase can interfere and cause a dependency resolution (e.g. this happens with antrun as reported in JBBUILD-585). Maybe it's your case.

can I turn that off?

If you are doing some fancy stuff during the clean phase, remove it :) Another option would be to run maven offline during a clean (with the -o or --offline options).

Pascal Thivent
It downloads the clean plugin when you clean though, doesn't it?
wds
@wds Indeed, the first time you run it, like any other plugin. But I don't think this is what the question is about (the question explicitly mentions *dependencies*).
Pascal Thivent
@Pascal Someone unfamiliar with maven nomenclature might confuse the two. In any case, just mentioning it for completeness sake.
wds