|
| 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; |
| 20 | + |
| 21 | +import org.apache.maven.api.annotations.Config; |
| 22 | + |
| 23 | +/** |
| 24 | + * Configuration constants. |
| 25 | + */ |
| 26 | +public final class Constants { |
| 27 | + |
| 28 | + /** |
| 29 | + * Maven home. |
| 30 | + * |
| 31 | + * @since 3.0.0 |
| 32 | + */ |
| 33 | + @Config(readOnly = true) |
| 34 | + public static final String MAVEN_HOME = "maven.home"; |
| 35 | + |
| 36 | + /** |
| 37 | + * Maven installation configuration directory. |
| 38 | + * |
| 39 | + * @since 4.0.0 |
| 40 | + */ |
| 41 | + @Config(defaultValue = "${maven.home}/conf") |
| 42 | + public static final String MAVEN_INSTALLATION_CONF = "maven.installation.conf"; |
| 43 | + |
| 44 | + /** |
| 45 | + * Maven user configuration directory. |
| 46 | + * |
| 47 | + * @since 4.0.0 |
| 48 | + */ |
| 49 | + @Config(defaultValue = "${user.home}/.m2") |
| 50 | + public static final String MAVEN_USER_CONF = "maven.user.conf"; |
| 51 | + |
| 52 | + /** |
| 53 | + * Maven project configuration directory. |
| 54 | + * |
| 55 | + * @since 4.0.0 |
| 56 | + */ |
| 57 | + @Config(defaultValue = "${session.rootDirectory}/.mvn") |
| 58 | + public static final String MAVEN_PROJECT_CONF = "maven.project.conf"; |
| 59 | + |
| 60 | + /** |
| 61 | + * Maven local repository. |
| 62 | + * |
| 63 | + * @since 3.0.0 |
| 64 | + */ |
| 65 | + @Config(defaultValue = "${maven.user.conf}/repository") |
| 66 | + public static final String MAVEN_REPO_LOCAL = "maven.repo.local"; |
| 67 | + |
| 68 | + /** |
| 69 | + * Maven installation settings. |
| 70 | + * |
| 71 | + * @since 4.0.0 |
| 72 | + */ |
| 73 | + @Config(defaultValue = "${maven.installation.conf}/settings.xml") |
| 74 | + public static final String MAVEN_INSTALLATION_SETTINGS = "maven.installation.settings"; |
| 75 | + |
| 76 | + /** |
| 77 | + * Maven user settings. |
| 78 | + * |
| 79 | + * @since 4.0.0 |
| 80 | + */ |
| 81 | + @Config(defaultValue = "${maven.user.conf}/settings.xml") |
| 82 | + public static final String MAVEN_USER_SETTINGS = "maven.user.settings"; |
| 83 | + |
| 84 | + /** |
| 85 | + * Maven project settings. |
| 86 | + * |
| 87 | + * @since 4.0.0 |
| 88 | + */ |
| 89 | + @Config(defaultValue = "${maven.project.conf}/settings.xml") |
| 90 | + public static final String MAVEN_PROJECT_SETTINGS = "maven.project.settings"; |
| 91 | + |
| 92 | + /** |
| 93 | + * Maven installation extensions. |
| 94 | + * |
| 95 | + * @since 4.0.0 |
| 96 | + */ |
| 97 | + @Config(defaultValue = "${maven.installation.conf}/extensions.xml") |
| 98 | + public static final String MAVEN_INSTALLATION_EXTENSIONS = "maven.installation.extensions"; |
| 99 | + |
| 100 | + /** |
| 101 | + * Maven user extensions. |
| 102 | + * |
| 103 | + * @since 4.0.0 |
| 104 | + */ |
| 105 | + @Config(defaultValue = "${maven.user.conf}/extensions.xml") |
| 106 | + public static final String MAVEN_USER_EXTENSIONS = "maven.user.extensions"; |
| 107 | + |
| 108 | + /** |
| 109 | + * Maven project extensions. |
| 110 | + * |
| 111 | + * @since 4.0.0 |
| 112 | + */ |
| 113 | + @Config(defaultValue = "${maven.project.conf}/extensions.xml") |
| 114 | + public static final String MAVEN_PROJECT_EXTENSIONS = "maven.project.extensions"; |
| 115 | + |
| 116 | + /** |
| 117 | + * Maven installation toolchains. |
| 118 | + * |
| 119 | + * @since 4.0.0 |
| 120 | + */ |
| 121 | + @Config(defaultValue = "${maven.installation.conf}/toolchains.xml") |
| 122 | + public static final String MAVEN_INSTALLATION_TOOLCHAINS = "maven.installation.toolchains"; |
| 123 | + |
| 124 | + /** |
| 125 | + * Maven user toolchains. |
| 126 | + * |
| 127 | + * @since 4.0.0 |
| 128 | + */ |
| 129 | + @Config(defaultValue = "${maven.user.home}/toolchains.xml") |
| 130 | + public static final String MAVEN_USER_TOOLCHAINS = "maven.user.toolchains"; |
| 131 | + |
| 132 | + /** |
| 133 | + * Extensions class path. |
| 134 | + */ |
| 135 | + @Config |
| 136 | + public static final String MAVEN_EXT_CLASS_PATH = "maven.ext.class.path"; |
| 137 | + |
| 138 | + /** |
| 139 | + * Maven output color mode. |
| 140 | + * Allowed values are <code>auto</code>, <code>always</code>, <code>never</code>. |
| 141 | + * |
| 142 | + * @since 4.0.0 |
| 143 | + */ |
| 144 | + @Config(defaultValue = "auto") |
| 145 | + public static final String MAVEN_STYLE_COLOR_PROPERTY = "maven.style.color"; |
| 146 | + |
| 147 | + /** |
| 148 | + * Build timestamp format. |
| 149 | + * |
| 150 | + * @since 3.0.0 |
| 151 | + */ |
| 152 | + @Config(source = Config.Source.MODEL, defaultValue = "yyyy-MM-dd'T'HH:mm:ssXXX") |
| 153 | + public static final String MAVEN_BUILD_TIMESTAMP_FORMAT = "maven.build.timestamp.format"; |
| 154 | + |
| 155 | + /** |
| 156 | + * User controlled relocations. |
| 157 | + * This property is a comma separated list of entries with the syntax <code>GAV>GAV</code>. |
| 158 | + * The first <code>GAV</code> can contain <code>*</code> for any elem (so <code>*:*:*</code> would mean ALL, something |
| 159 | + * you don't want). The second <code>GAV</code> is either fully specified, or also can contain <code>*</code>, |
| 160 | + * then it behaves as "ordinary relocation": the coordinate is preserved from relocated artifact. |
| 161 | + * Finally, if right hand <code>GAV</code> is absent (line looks like <code>GAV></code>), the left hand matching |
| 162 | + * <code>GAV</code> is banned fully (from resolving). |
| 163 | + * <p> |
| 164 | + * Note: the <code>></code> means project level, while <code>>></code> means global (whole session level, |
| 165 | + * so even plugins will get relocated artifacts) relocation. |
| 166 | + * </p> |
| 167 | + * <p> |
| 168 | + * For example, |
| 169 | + * <pre>maven.relocations.entries = org.foo:*:*>, \\<br/> org.here:*:*>org.there:*:*, \\<br/> javax.inject:javax.inject:1>>jakarta.inject:jakarta.inject:1.0.5</pre> |
| 170 | + * means: 3 entries, ban <code>org.foo group</code> (exactly, so <code>org.foo.bar</code> is allowed), |
| 171 | + * relocate <code>org.here</code> to <code>org.there</code> and finally globally relocate (see <code>>></code> above) |
| 172 | + * <code>javax.inject:javax.inject:1</code> to <code>jakarta.inject:jakarta.inject:1.0.5</code>. |
| 173 | + * </p> |
| 174 | + * |
| 175 | + * @since 4.0.0 |
| 176 | + */ |
| 177 | + @Config |
| 178 | + public static final String MAVEN_RELOCATIONS_ENTRIES = "maven.relocations.entries"; |
| 179 | + |
| 180 | + /** |
| 181 | + * User property for version filters expression, a semicolon separated list of filters to apply. By default, no version |
| 182 | + * filter is applied (like in Maven 3). |
| 183 | + * <p> |
| 184 | + * Supported filters: |
| 185 | + * <ul> |
| 186 | + * <li>"h" or "h(num)" - highest version or top list of highest ones filter</li> |
| 187 | + * <li>"l" or "l(num)" - lowest version or bottom list of lowest ones filter</li> |
| 188 | + * <li>"s" - contextual snapshot filter</li> |
| 189 | + * <li>"e(G:A:V)" - predicate filter (leaves out G:A:V from range, if hit, V can be range)</li> |
| 190 | + * </ul> |
| 191 | + * Example filter expression: <code>"h(5);s;e(org.foo:bar:1)</code> will cause: ranges are filtered for "top 5" (instead |
| 192 | + * full range), snapshots are banned if root project is not a snapshot, and if range for <code>org.foo:bar</code> is |
| 193 | + * being processed, version 1 is omitted. |
| 194 | + * </p> |
| 195 | + * |
| 196 | + * @since 4.0.0 |
| 197 | + */ |
| 198 | + @Config |
| 199 | + public static final String MAVEN_VERSION_FILTERS = "maven.versionFilters"; |
| 200 | + |
| 201 | + /** |
| 202 | + * User property for chained LRM: list of "tail" local repository paths (separated by comma), to be used with |
| 203 | + * {@code org.eclipse.aether.util.repository.ChainedLocalRepositoryManager}. |
| 204 | + * Default value: <code>null</code>, no chained LRM is used. |
| 205 | + * |
| 206 | + * @since 3.9.0 |
| 207 | + */ |
| 208 | + @Config |
| 209 | + public static final String MAVEN_REPO_LOCAL_TAIL = "maven.repo.local.tail"; |
| 210 | + |
| 211 | + /** |
| 212 | + * User property for reverse dependency tree. If enabled, Maven will record ".tracking" directory into local |
| 213 | + * repository with "reverse dependency tree", essentially explaining WHY given artifact is present in local |
| 214 | + * repository. |
| 215 | + * Default: <code>false</code>, will not record anything. |
| 216 | + * |
| 217 | + * @since 3.9.0 |
| 218 | + */ |
| 219 | + @Config(defaultValue = "false") |
| 220 | + public static final String MAVEN_REPO_LOCAL_RECORD_REVERSE_TREE = "maven.repo.local.recordReverseTree"; |
| 221 | + |
| 222 | + /** |
| 223 | + * User property for selecting dependency manager behaviour regarding transitive dependencies and dependency |
| 224 | + * management entries in their POMs. Maven 3 targeted full backward compatibility with Maven2, hence it ignored |
| 225 | + * dependency management entries in transitive dependency POMs. Maven 4 enables "transitivity" by default, hence |
| 226 | + * unlike Maven2, obeys dependency management entries deep in dependency graph as well. |
| 227 | + * <p> |
| 228 | + * Default: <code>"true"</code>. |
| 229 | + * </p> |
| 230 | + * |
| 231 | + * @since 4.0.0 |
| 232 | + */ |
| 233 | + @Config(defaultValue = "true") |
| 234 | + public static final String MAVEN_RESOLVER_DEPENDENCY_MANAGER_TRANSITIVITY = |
| 235 | + "maven.resolver.dependencyManagerTransitivity"; |
| 236 | + |
| 237 | + /** |
| 238 | + * Resolver transport to use. |
| 239 | + * Can be <code>default</code>, <code>wagon</code>, <code>apache</code>, <code>jdk</code> or <code>auto</code>. |
| 240 | + * |
| 241 | + * @since 4.0.0 |
| 242 | + */ |
| 243 | + @Config(defaultValue = "default") |
| 244 | + public static final String MAVEN_RESOLVER_TRANSPORT = "maven.resolver.transport"; |
| 245 | + |
| 246 | + /** |
| 247 | + * Plugin validation level. |
| 248 | + * |
| 249 | + * @since 3.9.2 |
| 250 | + */ |
| 251 | + @Config(defaultValue = "inline") |
| 252 | + public static final String MAVEN_PLUGIN_VALIDATION = "maven.plugin.validation"; |
| 253 | + |
| 254 | + /** |
| 255 | + * Plugin validation exclusions. |
| 256 | + * |
| 257 | + * @since 3.9.6 |
| 258 | + */ |
| 259 | + @Config |
| 260 | + public static final String MAVEN_PLUGIN_VALIDATION_EXCLUDES = "maven.plugin.validation.excludes"; |
| 261 | + |
| 262 | + /** |
| 263 | + * ProjectBuilder parallelism. |
| 264 | + * |
| 265 | + * @since 4.0.0 |
| 266 | + */ |
| 267 | + @Config(type = "java.lang.Integer", defaultValue = "cores/2 + 1") |
| 268 | + public static final String MAVEN_PROJECT_BUILDER_PARALLELISM = "maven.projectBuilder.parallelism"; |
| 269 | + |
| 270 | + private Constants() {} |
| 271 | +} |
0 commit comments