jira-importer commented on issue #587:
URL: 
https://github.com/apache/maven-deploy-plugin/issues/587#issuecomment-2771553806

   **[Jared 
Stehler](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jstehler)**
 commented
   
   Thanks for the pointers! I'd imagine that to use the listener approach, I'd 
need to call `RepositorySystemSession.setRepositoryListener()` in a mojo or 
extension prior to the deploy mojo execution, and that callback would happen 
within the context of the deploy mojo execution?
   
   Unfortunately our resolver isn't open source, but operates like this:
   
    
   The first part is the API. Every time a snapshot artifact is built, it 
reports to the API with the groupId, artifactId, base version, and the new 
resolved snapshot version. We keep track of the latest snapshot version for 
each group/artifact/version combo in a db table.
   
   The client portion is implemented as a Maven extension (installed by 
dropping a JAR in $M2_HOME/lib). When you run Maven, this extension gets loaded 
and hits the API. It asks the API for any new snapshot versions since the last 
time it ran. For each new snapshot, it writes the new snapshot timestamp to a 
file inside the .m2 repo.
   
   The extension also implements a custom update policy. Maven asks the update 
policy whether it needs to hit Nexus to check for a new snapshot version. To 
answer this question, the extension reads the aforementioned file containing 
the latest snapshot timestamp. It then loads the current maven-metadata.xml 
from disk and parses out the snapshot timestamp from there. If the timestamp is 
newer than the snapshot timestamp from the maven-metadata.xml, then there is a 
new snapshot version and it needs to hit Nexus to fetch it. Otherwise, we 
already have the latest snapshot and don't need to fetch anything.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to