As far as preventing overwrite of an existing remote artifact, you can use the 
exists-maven-plugin <https://github.com/chonton/exists-maven-plugin>.  
(https://github.com/chonton/exists-maven-plugin 
<https://github.com/chonton/exists-maven-plugin>) This plugin will check for 
the existence of a current artifact and set a property which can be used to 
‘skip’ later plugin execution.

By default, this plugin sets the maven.deploy.skip property to false if the 
current project’s non-snapshot artifact already exists in the remote 
repository, thus preventing attempted overwrite of final artifacts.  You could 
configure this plugin to set a different property or also prevent SNAPSHOT 
artifacts from being overwritten.

chas

> On Nov 17, 2016, at 11:48 PM, Hohl, Gerrit <[email protected]> wrote:
> 
> Hello everyone, :-)
> 
> 
> 
> is it somehow possible not to "install" an artifact which already exists
> in the local repository?
> 
> What about artifacts in a remote repository? Is it possible to prevent
> deployment of such artifacts?
> 
> 
> 
> I don't want to have our build server to accidentally install an
> artifact a second time just because someone forgot to change the
> version.
> 
> Even if that artifact isn't deployed to the remote repository it will be
> used on that build server.
> 
> In the maven-install-plugin description there is no option. But who
> knows...
> 
> 
> 
> I saw that there is the possibility in Nexus to prevent redeployement
> for a repository.
> 
> Is there also a way within Maven? Or not because Maven says it's the job
> of the repository server / service itself.
> 
> In the maven-deploy-plugin description there is no option. But who
> knows...
> 
> 
> 
> Regards,
> 
> Gerrit
> 
> 
> 

Reply via email to