diff --git a/apache-maven/src/assembly/maven/conf/maven.properties b/apache-maven/src/assembly/maven/conf/maven.properties index 7c1d76bf563e..2c80d55625c8 100644 --- a/apache-maven/src/assembly/maven/conf/maven.properties +++ b/apache-maven/src/assembly/maven/conf/maven.properties @@ -38,3 +38,8 @@ maven.user.toolchains = ${maven.user.conf}/toolchains.xml maven.installation.extensions = ${maven.installation.conf}/extensions.xml maven.project.extensions = ${maven.project.conf}/extensions.xml maven.user.extensions = ${maven.user.conf}/extensions.xml + +# +# Maven central repository URL. +# +maven.repo.central = ${env.MAVEN_REPO_CENTRAL:-https://repo.maven.apache.org/maven2} diff --git a/apache-maven/src/assembly/maven/conf/settings.xml b/apache-maven/src/assembly/maven/conf/settings.xml index 2291dd2e3853..05a46c88025a 100644 --- a/apache-maven/src/assembly/maven/conf/settings.xml +++ b/apache-maven/src/assembly/maven/conf/settings.xml @@ -174,7 +174,7 @@ under the License. central Central Repository - https://repo.maven.apache.org/maven2 + ${maven.repo.central} false @@ -188,7 +188,7 @@ under the License. central Central Repository - https://repo.maven.apache.org/maven2 + ${maven.repo.central} false diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java index d1f27cca0dcf..7cad394d0d57 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java @@ -65,6 +65,16 @@ public final class Constants { @Config(defaultValue = "${maven.user.conf}/repository") public static final String MAVEN_REPO_LOCAL = "maven.repo.local"; + /** + * Maven central repository URL. + * The property will have the value of the MAVEN_REPO_CENTRAL + * environment variable if it is defined. + * + * @since 4.0.0 + */ + @Config(defaultValue = "https://repo.maven.apache.org/maven2") + public static final String MAVEN_REPO_CENTRAL = "maven.repo.central"; + /** * Maven installation settings. * diff --git a/src/site/markdown/configuration.md b/src/site/markdown/configuration.md index f3c4f7897afc..5a7960ccab1a 100644 --- a/src/site/markdown/configuration.md +++ b/src/site/markdown/configuration.md @@ -39,15 +39,16 @@ under the License. | 12. | `maven.project.settings` | `String` | Maven project settings. | `${maven.project.conf}/settings.xml` | 4.0.0 | User properties | | 13. | `maven.projectBuilder.parallelism` | `Integer` | ProjectBuilder parallelism. | `cores/2 + 1` | 4.0.0 | User properties | | 14. | `maven.relocations.entries` | `String` | User controlled relocations. This property is a comma separated list of entries with the syntax GAV>GAV. The first GAV can contain \* for any elem (so \*:\*:\* would mean ALL, something you don't want). The second GAV is either fully specified, or also can contain \*, then it behaves as "ordinary relocation": the coordinate is preserved from relocated artifact. Finally, if right hand GAV is absent (line looks like GAV>), the left hand matching GAV is banned fully (from resolving).
Note: the > means project level, while >> means global (whole session level, so even plugins will get relocated artifacts) relocation.
For example,
maven.relocations.entries = org.foo:\*:\*>, \\
org.here:\*:\*>org.there:\*:\*, \\
javax.inject:javax.inject:1>>jakarta.inject:jakarta.inject:1.0.5
means: 3 entries, ban org.foo group (exactly, so org.foo.bar is allowed), relocate org.here to org.there and finally globally relocate (see >> above) javax.inject:javax.inject:1 to jakarta.inject:jakarta.inject:1.0.5. | - | 4.0.0 | User properties | -| 15. | `maven.repo.local` | `String` | Maven local repository. | `${maven.user.conf}/repository` | 3.0.0 | User properties | -| 16. | `maven.repo.local.recordReverseTree` | `String` | User property for reverse dependency tree. If enabled, Maven will record ".tracking" directory into local repository with "reverse dependency tree", essentially explaining WHY given artifact is present in local repository. Default: false, will not record anything. | `false` | 3.9.0 | User properties | -| 17. | `maven.repo.local.tail` | `String` | User property for chained LRM: list of "tail" local repository paths (separated by comma), to be used with {@code org.eclipse.aether.util.repository.ChainedLocalRepositoryManager} . Default value: null, no chained LRM is used. | - | 3.9.0 | User properties | -| 18. | `maven.resolver.dependencyManagerTransitivity` | `String` | User property for selecting dependency manager behaviour regarding transitive dependencies and dependency management entries in their POMs. Maven 3 targeted full backward compatibility with Maven2, hence it ignored dependency management entries in transitive dependency POMs. Maven 4 enables "transitivity" by default, hence unlike Maven2, obeys dependency management entries deep in dependency graph as well.
Default: "true". | `true` | 4.0.0 | User properties | -| 19. | `maven.resolver.transport` | `String` | Resolver transport to use. Can be default, wagon, apache, jdk or auto. | `default` | 4.0.0 | User properties | -| 20. | `maven.style.color` | `String` | Maven output color mode. Allowed values are auto, always, never. | `auto` | 4.0.0 | User properties | -| 21. | `maven.user.conf` | `String` | Maven user configuration directory. | `${user.home}/.m2` | 4.0.0 | User properties | -| 22. | `maven.user.extensions` | `String` | Maven user extensions. | `${maven.user.conf}/extensions.xml` | 4.0.0 | User properties | -| 23. | `maven.user.settings` | `String` | Maven user settings. | `${maven.user.conf}/settings.xml` | 4.0.0 | User properties | -| 24. | `maven.user.toolchains` | `String` | Maven user toolchains. | `${maven.user.home}/toolchains.xml` | 4.0.0 | User properties | -| 25. | `maven.versionFilters` | `String` | 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).
Supported filters: Example filter expression: "h(5);s;e(org.foo:bar:1) 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 org.foo:bar is being processed, version 1 is omitted. | - | 4.0.0 | User properties | +| 15. | `maven.repo.central` | `String` | Maven central repository URL. The property will have the value of the MAVEN_REPO_CENTRAL environment variable if it is defined. | `https://repo.maven.apache.org/maven2` | 4.0.0 | User properties | +| 16. | `maven.repo.local` | `String` | Maven local repository. | `${maven.user.conf}/repository` | 3.0.0 | User properties | +| 17. | `maven.repo.local.recordReverseTree` | `String` | User property for reverse dependency tree. If enabled, Maven will record ".tracking" directory into local repository with "reverse dependency tree", essentially explaining WHY given artifact is present in local repository. Default: false, will not record anything. | `false` | 3.9.0 | User properties | +| 18. | `maven.repo.local.tail` | `String` | User property for chained LRM: list of "tail" local repository paths (separated by comma), to be used with {@code org.eclipse.aether.util.repository.ChainedLocalRepositoryManager} . Default value: null, no chained LRM is used. | - | 3.9.0 | User properties | +| 19. | `maven.resolver.dependencyManagerTransitivity` | `String` | User property for selecting dependency manager behaviour regarding transitive dependencies and dependency management entries in their POMs. Maven 3 targeted full backward compatibility with Maven2, hence it ignored dependency management entries in transitive dependency POMs. Maven 4 enables "transitivity" by default, hence unlike Maven2, obeys dependency management entries deep in dependency graph as well.
Default: "true". | `true` | 4.0.0 | User properties | +| 20. | `maven.resolver.transport` | `String` | Resolver transport to use. Can be default, wagon, apache, jdk or auto. | `default` | 4.0.0 | User properties | +| 21. | `maven.style.color` | `String` | Maven output color mode. Allowed values are auto, always, never. | `auto` | 4.0.0 | User properties | +| 22. | `maven.user.conf` | `String` | Maven user configuration directory. | `${user.home}/.m2` | 4.0.0 | User properties | +| 23. | `maven.user.extensions` | `String` | Maven user extensions. | `${maven.user.conf}/extensions.xml` | 4.0.0 | User properties | +| 24. | `maven.user.settings` | `String` | Maven user settings. | `${maven.user.conf}/settings.xml` | 4.0.0 | User properties | +| 25. | `maven.user.toolchains` | `String` | Maven user toolchains. | `${maven.user.home}/toolchains.xml` | 4.0.0 | User properties | +| 26. | `maven.versionFilters` | `String` | 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).
Supported filters: Example filter expression: "h(5);s;e(org.foo:bar:1) 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 org.foo:bar is being processed, version 1 is omitted. | - | 4.0.0 | User properties |