cstamas commented on code in PR #1597: URL: https://github.com/apache/maven/pull/1597#discussion_r1670707775
########## api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java: ########## @@ -0,0 +1,239 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.api; + +import org.apache.maven.api.annotations.Config; + +/** + * Configuration constants. + */ +public final class Constants { + + /** + * Maven home. + * + * @since 3.0.0 + */ + @Config(readOnly = true) + public static final String MAVEN_HOME = "maven.home"; + + /** + * Maven configuration. + * + * @since 3.0.0 + */ + @Config(defaultValue = "${maven.home}/conf") + public static final String MAVEN_CONF = "maven.conf"; + + /** + * Maven user home. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${user.home}/.m2") + public static final String MAVEN_USER_HOME = "maven.user.home"; + + /** + * Maven local repository. + * + * @since 3.0.0 + */ + @Config(defaultValue = "${maven.user.home}/repository") + public static final String MAVEN_REPO_LOCAL = "maven.repo.local"; + + /** + * Maven system-wide extensions. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${maven.conf}/extensions.xml") + public static final String MAVEN_SYSTEM_EXTENSIONS = "maven.system.extensions"; + + /** + * Maven user extensions. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${maven.user.home}/extensions.xml") + public static final String MAVEN_USER_EXTENSIONS = "maven.user.extensions"; + + /** + * Maven project-wide extensions. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${session.rootDirectory}/.mvn/extensions.xml") + public static final String MAVEN_PROJECT_EXTENSIONS = "maven.project.extensions"; + + /** + * Maven system toolchains. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${maven.conf}/toolchains.xml") + public static final String MAVEN_SYSTEM_TOOLCHAINS = "maven.system.toolchains"; + + /** + * Maven user toolchains. + * + * @since 4.0.0 + */ + @Config(defaultValue = "${maven.user.home}/toolchains.xml") + public static final String MAVEN_USER_TOOLCHAINS = "maven.user.toolchains"; + + /** + * Extensions class path. + */ + @Config + public static final String MAVEN_EXT_CLASS_PATH = "maven.ext.class.path"; + + /** + * Maven output color mode. + * Allowed values are <code>auto</code>, <code>always</code>, <code>never</code>. + * + * @since 4.0.0 + */ + @Config(defaultValue = "auto") + public static final String MAVEN_STYLE_COLOR_PROPERTY = "maven.style.color"; + + /** + * Build timestamp format. + * + * @since 3.0.0 + */ + @Config(source = Config.Source.MODEL, defaultValue = "yyyy-MM-dd'T'HH:mm:ss'Z'") + public static final String MAVEN_BUILD_TIMESTAMP_FORMAT = "maven.build.timestamp.format"; + + /** + * User controlled relocations. + * This property is a comma separated list of entries with the syntax <code>GAV>GAV</code>. + * The first <code>GAV</code> can contain <code>*</code> for any elem (so <code>*:*:*</code> would mean ALL, something + * you don't want). The second <code>GAV</code> is either fully specified, or also can contain <code>*</code>, + * then it behaves as "ordinary relocation": the coordinate is preserved from relocated artifact. + * Finally, if right hand <code>GAV</code> is absent (line looks like <code>GAV></code>), the left hand matching + * <code>GAV</code> is banned fully (from resolving). + * <p> + * Note: the <code>></code> means project level, while <code>>></code> means global (whole session level, + * so even plugins will get relocated artifacts) relocation. + * </p> + * <p> + * For example, + * <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> + * means: 3 entries, ban <code>org.foo group</code> (exactly, so <code>org.foo.bar</code> is allowed), + * relocate <code>org.here</code> to <code>org.there</code> and finally globally relocate (see <code>>></code> above) + * <code>javax.inject:javax.inject:1</code> to <code>jakarta.inject:jakarta.inject:1.0.5</code>. + * </p> + * + * @since 4.0.0 + */ + @Config + public static final String MAVEN_RELOCATIONS_ENTRIES = "maven.relocations.entries"; + + /** + * User property for version filters expression, a semicolon separated list of filters to apply. By default, no version + * filter is applied (like in Maven 3). + * <p> + * Supported filters: + * <ul> + * <li>"h" or "h(num)" - highest version or top list of highest ones filter</li> + * <li>"l" or "l(num)" - lowest version or bottom list of lowest ones filter</li> + * <li>"s" - contextual snapshot filter</li> + * <li>"e(G:A:V)" - predicate filter (leaves out G:A:V from range, if hit, V can be range)</li> + * </ul> + * Example filter expression: <code>"h(5);s;e(org.foo:bar:1)</code> will cause: ranges are filtered for "top 5" (instead + * full range), snapshots are banned if root project is not a snapshot, and if range for <code>org.foo:bar</code> is + * being processed, version 1 is omitted. + * </p> + * + * @since 4.0.0 + */ + @Config + public static final String MAVEN_VERSION_FILTERS = "maven.versionFilters"; Review Comment: I think you are missing the point of this PR. Also as I said, "renaming" (or "properly naming") these is out of scope for this PR, let's collected them first. -- 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