maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Re: Is there any maven plugin to add dependency to existing pom.xml ?
Date Sat, 12 Oct 2013 12:23:00 GMT
I use the maven invoker plugin for this, by parameterizing a pom so
that I can substitute various versions. By using the 'pom dependency'
thing, you could perhaps do this for entire dependencies as opposed to
versions. Or you could script pom editing; there are XML-editing Maven
plugin and ant plugins out there.

On Fri, Oct 11, 2013 at 2:45 PM, sizu <scottizu@gmail.com> wrote:
> Example using sed:
>
> sed
> 's/<dependencies>/<dependencies>\r\n\r\n<dependency>\r\n<groupId>org.ghost4j<\/groupId>\r\n<artifactId>ghost4j<\/artifactId>\r\n<version>0.5.0<\/version>\r\n<\/dependency>\r\n/g'
> pom.xml > pom2.xml
>
> Replaces the dependencies tag with the dependencies tag followed by the new
> dependency (inserts the new dependency first in the list.
>
> Creates a new file pom2.xml with the new dependency (this can be changed to
> overwrite the original file using: pom.xml > pom.xml
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Is-there-any-maven-plugin-to-add-dependency-to-existing-pom-xml-tp2839092p5772863.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message