You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The repository definition for stage will need to be:
** Discrete from other repositories.
** Discrete from any nexus 'mirror' id set in a mirror definition.
Maven's 'enhanced' local repo managers (aether, if you really want to get pendantic) like to cache source repositories by repo (server) "Id", not by URI base path.
This has the consequence of: If you use an authenticated mirror for your 'central' proxy (to say, public/groups in nexus 2 parlance), and you give that mirror an 'id'...
For argument sake, let's say that's 'corporate-nexus-proxy', and then define your credentials for 'coroporate-nexus-proxy'.
Running maven and having dependencies resolve from that mirror, will get them recorded in the local repo as having come from 'corporate-nexus-proxy'.
If you use that same 'id' as part of your stage repository definition:
`<stageDeploymentRepository>corporate-nexus-proxy::foo::bar::false</stageDeploymentRepository>`
Then any non-snapshot dependency will look like it came from the 'stage' repository, and the 'update-stage-dependencies' will purge all your local non-snapshot dependencies and re-resolve them. Yick.
If you use a discrete id for the `stageDeploymentRepository` (a good idea, from a security standpoint, in fact), this won't happen, and only things which were actually resolved from the stage repo's id into your local will become elligable for purging.
This is doubly awesome, in that once a thing locally resolved from stage gets purged, and then reresolved from 'release' (due it having been you know, promoted) your local repo will stop purging them, since the remote ID wouldn't match the stage repo Id anymore.
It's a bit convoluted, but I'll update the docs and readmes in due-course.. and I may move this behavior to the extension (if I can reliably inject the necessary bits) to purge earlier in the build cycle.
getLog().warn("Failed to purge stage artifact from local repository: " + deleteTarget, ioe);
71
+
}
72
+
} elseif (!deleteTarget.delete()) {
73
+
getLog().warn("Failed to purge stage artifact from local repository: " + deleteTarget);
74
+
}
75
+
itemsPurged = true;
76
+
}
77
+
}
78
+
}
79
+
} catch (DependencyResolutionExceptiondre) {
80
+
thrownewMojoExecutionException("Initial dependency resolution to resolve dependencies which may have been provided by the 'stage' repository failed.", dre);
0 commit comments