I'am currently trying to remove from an xml file all nodes containing a specific pattern.
I need to remove all block :
<artifactItem>...</artifactItem> containing libprogram-* in <artifactId>libprograms-*</artifactId>
Here is the xml (only the beggining) :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--
<parent>
<groupId>lu.foyer.exzos</groupId>
<artifactId>exzos</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
-->
<groupId>lu.foyer.exzos</groupId>
<artifactId>foyer-pms</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Foyer Pms</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<!--outputDirectory>${project.basedir}/run/programs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTransitive>true</excludeTransitive-->
<artifactItems>
<!-- Programs dependencies -->
<artifactItem>
<groupId>lu.foyer.exzos</groupId>
<artifactId>XactAnubexSyncJavaSupLib</artifactId>
<version>1.0-SNAPSHOT</version>
<outputDirectory>${project.basedir}/run/programs</outputDirectory>
<destFileName>XactAnubexSyncJavaSupLib.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>exzos.bazel</groupId>
<artifactId>libprograms-client-cobol</artifactId>
<version>1.0-SNAPSHOT</version>
<outputDirectory>${project.basedir}/run/programs</outputDirectory>
<destFileName>libprograms-client-cobol.jar</destFileName>
</artifactItem>
...
I tried several sed commands but without success.
Any help would be appreciated.
Thanks