Hi Robert,

On 8/6/16 3:22 PM, Robert Scholte wrote:
Hi Karl Heinz,

This all sounds like repository policies[1], so something that should be
part of Aether.
Disabling such repositories should prevent them from downloading.
(assuming --offline is not an option)
From a plugin of MavenProject point of view I'm not interested in the
logic behind it: either give me the artifacts or break the build if
they're not available.
I assume you're looking for some like timeToLive as an option for a
SNAPSHOT repository. Might be interesting to add that to the
settings.xml. Be aware that the repository also contains metadata, so
simply removing an artifact doesn't sounds like a good approach. Instead
there should be a very clear Exception that you cannot download a fresh
SNAPSHOT even though there are still versions available in the local repo.

My use case is in my incremental module builder to identify automatically if a user has made the initial "mvn install" (which is needed at the moment or using the SNAPSHOT's from remote repository) ...if not i could say and end with an appropriate error message...

But I'm not sure if this is a good idea to limit it in that way ? Or just let the user decide to run mvn install or not ?

May be I'm on the wrong path...

Need to think about that a little bit more...

Thanks for your answer...



thanks,
Robert
[1]
https://maven.apache.org/ref/3.3.9/maven-settings/settings.html#class_repository


On Sat, 06 Aug 2016 13:19:07 +0200, Karl Heinz Marbaise
<[email protected]> wrote:

Hi,

If I do a mvn install with a project all artifacts are being installed
into my local cache..


The question I have:

Can I somehow identify if an artifact is already been in my local
cache or not (within a Maven plugin or extension)?

Something like:

if (artifact is in local cache) {
    Do...
}
else
{
    Do something different..
}

If I can check it somehow, can I furthermore check how long the
artifacts has been there  based on the update policy ? So can i see ok
this artifact has been there since yesterday so it would make sense to
update it? (I assume based on modification date simply?)...

Furthermore is there a way to prevent downloading from remote repos if
the artifact is not in my local cache?


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to