Automating component deletion in Nexus 3
<p>I am attempting to delete some components in a repository via the nexus 3 api </p>

<p>I have followed the instructions in the following question 
<a href="https://stackoverflow.com/questions/41063108/using-the-nexus3-api-how-do-i-get-a-list-of-artifacts-in-a-repository/41070107#41070107">Using the Nexus3 API how do I get a list of artifacts in a repository</a></p>

<p>and have modified it as follows to delete an artifact </p>

<pre><code>import groovy.json.JsonOutput
import org.sonatype.nexus.repository.storage.Component
import org.sonatype.nexus.repository.storage.Query
import org.sonatype.nexus.repository.storage.StorageFacet

def repoName = "eddie-test"
def startDate = "2016/01/01"
def artifactName = "you-artifact-name"
def artifactVersion = "1.0.6"

log.info(" Attempting to delete for repository: ${repoName} as of startDate: ${startDate}")

def repo = repository.repositoryManager.get(repoName)
StorageFacet storageFacet = repo.facet(StorageFacet)
def tx = storageFacet.txSupplier().get()

tx.begin()

// build a query to return a list of components scoped by name and version
Iterable&lt;Component&gt; foundComponents = tx.findComponents(Query.builder().where('name = ').param(artifactName).and('version = ').param(artifactVersion).build(), [repo])

// extra logic for validation goes here
if (foundComponents.size() == 1) {
    tx.deleteComponent(foundComponents[0])
}

tx.commit()
log.info("done")
</code></pre>

<p>however when I interrogate the maven-metadata.xml in 
<a href="http://localhost:32769/repository/eddie-test/com/company/you-artifact-name/maven-metadata.xml" rel="nofollow noreferrer">http://localhost:32769/repository/eddie-test/com/company/you-artifact-name/maven-metadata.xml</a>
the version is still listed.
i.e. </p>

<blockquote>
<pre><code>&lt;metadata&gt;
   &lt;groupId&gt;com.company&lt;/groupId&gt;
   &lt;artifactId&gt;you-artifact-name&lt;/artifactId&gt;
   &lt;versioning&gt;
       &lt;release&gt;1.0.7&lt;/release&gt;
       &lt;versions&gt;
           &lt;version&gt;1.0.6&lt;/version&gt;
           &lt;version&gt;1.0.7&lt;/version&gt;
       &lt;/versions&gt;
       &lt;lastUpdated&gt;20161213115754&lt;/lastUpdated&gt;
   &lt;/versioning&gt;
</code></pre>
  
  <p></p>
</blockquote>

<p>(<em>deleting the component via the delete component button in the ui, updates the maven-metadata.xml as expected</em>)</p>

<p>So is there a way to make sure that the file is updated when deleting via the API?</p>