[ 
https://issues.apache.org/jira/browse/MRESOLVER-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17775000#comment-17775000
 ] 

ASF GitHub Bot commented on MRESOLVER-377:
------------------------------------------

cstamas commented on code in PR #308:
URL: https://github.com/apache/maven-resolver/pull/308#discussion_r1358558127


##########
maven-resolver-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java:
##########
@@ -62,26 +62,40 @@ public final class RepositoryPolicy {
 
     private final String updatePolicy;
 
+    private final String metadataUpdatePolicy;
+
     private final String checksumPolicy;
 
     /**
      * Creates a new policy with checksum warnings and daily update checks.
      */
     public RepositoryPolicy() {
-        this(true, UPDATE_POLICY_DAILY, CHECKSUM_POLICY_WARN);
+        this(true, UPDATE_POLICY_DAILY, UPDATE_POLICY_DAILY, 
CHECKSUM_POLICY_WARN);
+    }
+
+    /**
+     * Creates a new policy with the specified settings (uses same update 
policy for data and metadata, retains old
+     * resolver behaviour).
+     */
+    public RepositoryPolicy(boolean enabled, String updatePolicy, String 
checksumPolicy) {
+        this(enabled, updatePolicy, updatePolicy, checksumPolicy);
     }
 
     /**
      * Creates a new policy with the specified settings.
      *
      * @param enabled A flag whether the associated repository should be 
accessed or not.
      * @param updatePolicy The update interval after which locally cached data 
from the repository is considered stale
-     *            and should be refetched, may be {@code null}.
+     *            and should be re-fetched, may be {@code null}.
+     * @param metadataUpdatePolicy The update interval after which locally 
cached metadata from the repository is considered stale
+     *            and should be re-fetched, may be {@code null}.
      * @param checksumPolicy The way checksum verification should be handled, 
may be {@code null}.
+     * @since TBD
      */
-    public RepositoryPolicy(boolean enabled, String updatePolicy, String 
checksumPolicy) {
+    public RepositoryPolicy(boolean enabled, String updatePolicy, String 
metadataUpdatePolicy, String checksumPolicy) {

Review Comment:
   Agree, but in this case we must preserve binary compatibility... So "all is 
as before, just doubled"...





> Introduce metadata update policy
> --------------------------------
>
>                 Key: MRESOLVER-377
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-377
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: Resolver
>            Reporter: Tamas Cservenak
>            Priority: Major
>             Fix For: 2.0.0
>
>
> Basically double the update policy, from RemoteRepository all way where 
> needed, and make Resolver support separate "data" updatePolicy and "metadata" 
> updatePolicy.
> Maven does not have to make use of this (setting updatePolicy == 
> metadataUpdatePolicy results in functionality like today, where there is only 
> one policy).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to