Hello,
I understand that this is not what you are asking for, but normally you would 
not allow to overwrite artifacts in the release repository. This way it cannot 
happen that a forgotten version Update overwrites released artifacts.
For snapshot artifacts on the other side you get a new timestamp (which is 
usually what you want since otherwise the artifacts might be outdated).
I can understand where you are coming from with your question, but I would keep 
it simple: have the developer specify a version when you use the release plugin 
(via CI server support). If you are planning to create unique versions for each 
CI build job, you can do that as well. In both cases your repo will protect you 
from overwriting artifacts.

Gruss
Bernd
-- 
http://bernd.eckenfels.net




On Mon, Nov 28, 2016 at 9:11 AM +0100, "Hohl, Gerrit" <g.h...@aurenz.de> wrote:










Hello everyone, :-)

seems my question was an odd one as I didn't get any replies on it.
So maybe I modify it a little bit:
Is it possible - maybe with an own Maven plugin - to check if an artifact is 
already in the remote / central repository of my company?

The goal is the following:

Each check-in into the SCM triggers a build which builds with "install" on the 
Jenkins build server.
Except if that version is already in the central Nexus repository of the 
company.
A manually triggered build on the Jenkins build server will build with "deploy".
Except if that version is already in the central Nexus repository of the 
company.

This way always the newest version of an artifact would be available for other 
artifact build processes which depend on it.
But versions which have been already "released" wouldn't be changed / 
overwritten.
Otherwise they would change on the build server because someone forgot to 
change the version and break other builds on that machine.

Does someone of you know if it is possible to realize something like that with 
already existing (and still maintained / developed) plugins?
Or how a programmatically solution could look like? Means does someone know 
what the Maven classes for accessing the remote repository are?

Regards,
Gerrit
-----Ursprüngliche Nachricht-----
Von: Hohl, Gerrit [mailto:g.h...@aurenz.de] 
Gesendet: Freitag, 18. November 2016 08:48
An: users@maven.apache.org
Betreff: Don't overwrite existing artifact - how?

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

 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org






Reply via email to