views:

77

answers:

2

Is there a way to add dependencies to an existing pom.xml via shell script?

Something like:

mvn dependency:add -DgroupID=com.acme -DartifactId=project

[Update] Clarified that I want to add to an existing pom

+1  A: 

I assume you would like to add that dependency to an existing POM, so the answer is no.

khmarbaise
@khmarbaise Yes, I meant an existing pom.xml. Would be a nice addition IMO. Too bad. I can understand why though - if you add version numbering or exclusions it becomes a little unwieldy and the logic to inject it maybe to complex.
oschrenk
+1  A: 

I'm not aware of any plugin doing this (apart from the m2eclipse wizard but that's not what you're asking for). This would be a nice addition to the dependency plugin (in the spirit of dependency:get) though. You should suggest to add the feature: http://jira.codehaus.org/browse/MDEP (I did a quick search but couldn't find something close).

Pascal Thivent
@Pascal I opened an issue. Let's wait what the MDEP guys think.
oschrenk
@oschrenk voted for it :)
Pascal Thivent