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-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org