Skip to content

Instantly share code, notes, and snippets.

@mcandre
Last active May 20, 2019 20:59
Show Gist options
  • Select an option

  • Save mcandre/75f84c278cbe41c1cd60 to your computer and use it in GitHub Desktop.

Select an option

Save mcandre/75f84c278cbe41c1cd60 to your computer and use it in GitHub Desktop.
# Select <scm> tag
xml sel \
-N x=http://maven.apache.org/POM/4.0.0 \
-t \
-c '/x:project/x:scm' \
pom.xml
# Output with updated <scm> tag
xml ed \
-N x=http://maven.apache.org/POM/4.0.0 \
-u '/x:project/x:scm/x:connection' -v "scm:git:$GIT_REPOSITORY" \
-u '/x:project/x:scm/x:url' -v $GIT_REPOSITORY \
pom.xml
# In-place file update
xml ed \
--inplace \
-N x=http://maven.apache.org/POM/4.0.0 \
-u '/x:project/x:scm/x:connection' -v "scm:git:$GIT_REPOSITORY" \
-u '/x:project/x:scm/x:url' -v $GIT_REPOSITORY \
pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment