Skip to content

[MNG-8167] enable "split repo" in settings.xml #10601

Open

Description

@jira-importer

Benjamin Marwell opened MNG-8167 and commented

With the availability of "-Daether.enhancedLocalRepository.split" and others, this should be settable in settings.xml.

Rationale: the repo should not have two layouts (or more) locally. Settings.xml should at least be able to define a default.


No further details from MNG-8167

Activity

  1. jira-importer commented on Jun 28, 2024

    @jira-importer
    Author

    Michael Osipov commented

    I am a bit confused. We did enable the able to pass user properties from settings to the Maven session...
    sjaranowski did that and I did back port to 3.8.x...

  2. jira-importer commented on Jun 28, 2024

    @jira-importer
    Author

    Slawomir Jaranowski commented

    Yes we can use aether.enhancedLocalRepository.*  in settings properties.

  3. jira-importer commented on Jun 28, 2024

    @jira-importer
    Author

    Benjamin Marwell commented

    So, create a profile? Why does localRepository does not need a profile?
    I think having to wrap this in a profile is a drawback. It should not be (de-)activatable.

    https://maven.apache.org/settings.html

    It is only mentioned in pom.xml which I do not want to edit.
    https://maven.apache.org/pom.html#Properties

    Thanks!

  4. jira-importer commented on Aug 29, 2024

    @jira-importer
    Author

    Guillaume Nodet commented

    Those properties will be able to defined in the maven.properties config file.

  5. jira-importer commented on Oct 15, 2024

    @jira-importer
    Author

    Guillaume Nodet commented

    Fwiw, I tried the following earlier this week:

    ➜  jline3 git:(master) ✗ cat ~/.m2/maven.properties 
    1. Move user conf directory to ~/.mvn
    maven.user.conf = ${user.home}/.mvn
    
    1. Load maven properties from ~/.mvn/maven.properties
    ${includes} = ?"${maven.user.conf}/maven.properties"
    
    ➜  jline3 git:(master) ✗ cat ~/.mvn/maven.properties
    1. Change the repository name to make sure 
    1. we don't have a conflict with a maven 2.x repository
    maven.repo.local = ${maven.user.conf}/repo-split
    
    1. Enable split repository by default
    aether.lrm.enhanced.split = true
    

    The goal was to experiment with using a split repository when using Maven 4 (since the maven.properties file is not supported by Maven 3). It works, but IntelliJ IDEA falls short as it does not support that yet (support for full split-repo seems to come soon).

  6. jira-importer commented on Oct 15, 2024

    @jira-importer
    Author

    Benjamin Marwell commented

    Much better!

    Current state (maven 3) is to add this profile to your {}$HOME/.m2/settings.xml{}:

         <profile>
           <id>split-repo</id>
           <properties>
             <aether.enhancedLocalRepository.split>true</aether.enhancedLocalRepository.split>
             <aether.enhancedLocalRepository.splitLocal>true</aether.enhancedLocalRepository.splitLocal>
             <aether.enhancedLocalRepository.splitRemoteRepository>true</aether.enhancedLocalRepository.splitRemoteRepository>
    
             <!--aether.artifactResolver.postProcessor.trustedChecksums>true</aether.artifactResolver.postProcessor.trustedChecksums-->
             <!-- aether.checksums.algorithms>SHA-512,SHA-1,MD5</aether.checksums.algorithms -->
           </properties>
         </profile> 

    And then activate it by default, just to make sure you don't get both split and unsplit dependencies:

    <activeProfiles>
      <activeProfile>split-repo</activeProfile>
    </activeProfiles>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions