1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.maven.api.cache;
20
21 import org.apache.maven.api.annotations.Experimental;
22
23 /**
24 * Enumeration defining different retention periods for cached data.
25 * Each value represents a specific scope and lifetime for cached items.
26 *
27 * @since 4.0.0
28 */
29 @Experimental
30 public enum CacheRetention {
31 /**
32 * Data should be persisted across Maven invocations.
33 * Suitable for:
34 * - Dependency resolution results
35 * - Compilation outputs
36 * - Downloaded artifacts
37 */
38 PERSISTENT,
39
40 /**
41 * Data should be retained for the duration of the current Maven session.
42 * Suitable for:
43 * - Build-wide configuration
44 * - Project model caching
45 * - Inter-module metadata
46 */
47 SESSION_SCOPED,
48
49 /**
50 * Data should only be retained for the current build request.
51 * Suitable for:
52 * - Plugin execution results
53 * - Temporary build artifacts
54 * - Phase-specific data
55 */
56 REQUEST_SCOPED,
57
58 /**
59 * Caching should be disabled for this data.
60 * Suitable for:
61 * - Sensitive information
62 * - Non-deterministic operations
63 * - Debug or development data
64 */
65 DISABLED
66 }