[ 
https://issues.apache.org/jira/browse/MSHARED-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Slawomir Jaranowski updated MSHARED-1147:
-----------------------------------------
    Description: 
We can provide {{settingsFile}} as one of constructor argument.

This value is used only for detecting Maven local repository, *not is used as 
settings* for tested Maven project.

Detecting Maven local repository path is done in order by - first wins:
 - value in provided by {{setLocalRepo}} methods
 - value in {{maven.repo.local}} system property
 - parsing file provided as {{settingsFile}} - from constructor argument
 - parsing {{.m2/settings.xml}} - can be different set by {{-s}} options

h1. Proposition

remove this arguments at all, and introduce new system property (like): 
{{settings.localRepository}}

Than we can detect Maven local repository in order by:
 - value in provided by {{setLocalRepo }} (by the way we have 
{{{}getLocalRepository{}}})
 - value in system property {{settings.localRepository}}
 - throw exception if not found - we always need this value for rest of methods 
like {{get|delete|verifyArtifact..}}

We can provide {{settings.localRepository}} by surefire config:
{code:java}
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              
<settings.localRepository>${settings.localRepository}</settings.localRepository>
            </systemPropertyVariables>
          </configuration>
        </plugin>
{code}
With such configuration we always have correct path, not important if
 - user provide {{-Dmaven.repo.local=}} as Maven build property
 - user provide custom settings path by {{-s}}

  was:
We can provide {{settingsFile}} as one of constructor argument.

This value is used only for detecting Maven local repository, *not is used as 
settings* for tested Maven project.

Detecting Maven local repository path is done in order by - first wins:
 - value in provided by {{setLocalRepo}} methods
 - value in {{maven.repo.local}} system property
 - parsing file provided as {{settingsFile}} - from constructor argument
 - parsing {{.m2/settings.xml}} - can be different set by {{-s}} options

h1. Proposition

remove this arguments at all, and introduce new system property (like): 
{{settings.localRepository}}

Than we can detect Maven local repository in order by:
 - value in provided by {{setLocalRepo }} (by the way we have 
{{getLocalRepository}})
 - value in system property {{settings.localRepository}}
 - throw exception if not found - we always need this value for rest of methods 
like {{get|delete|verifyArtifact..}}

We can provide {{settings.localRepository}} by surefire config:
{code:java}
<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <systemPropertyVariables>
              
<settings.localRepository>${settings.localRepository}</settings.localRepository>
            </systemPropertyVariables>
          </configuration>
        </plugin>
{code}
With such configuration we always have correct path, not important if
 - user provide {{-Dmaven.repo.local=}} as Maven build property
 - user provide custom settings path by {{-s}}


> Inconsistent for settingsFile argument - Maven local repository detecting
> -------------------------------------------------------------------------
>
>                 Key: MSHARED-1147
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1147
>             Project: Maven Shared Components
>          Issue Type: Improvement
>          Components: maven-verifier
>            Reporter: Slawomir Jaranowski
>            Priority: Major
>             Fix For: maven-verifier-2.0.0
>
>
> We can provide {{settingsFile}} as one of constructor argument.
> This value is used only for detecting Maven local repository, *not is used as 
> settings* for tested Maven project.
> Detecting Maven local repository path is done in order by - first wins:
>  - value in provided by {{setLocalRepo}} methods
>  - value in {{maven.repo.local}} system property
>  - parsing file provided as {{settingsFile}} - from constructor argument
>  - parsing {{.m2/settings.xml}} - can be different set by {{-s}} options
> h1. Proposition
> remove this arguments at all, and introduce new system property (like): 
> {{settings.localRepository}}
> Than we can detect Maven local repository in order by:
>  - value in provided by {{setLocalRepo }} (by the way we have 
> {{{}getLocalRepository{}}})
>  - value in system property {{settings.localRepository}}
>  - throw exception if not found - we always need this value for rest of 
> methods like {{get|delete|verifyArtifact..}}
> We can provide {{settings.localRepository}} by surefire config:
> {code:java}
>         <plugin>
>           <groupId>org.apache.maven.plugins</groupId>
>           <artifactId>maven-surefire-plugin</artifactId>
>           <configuration>
>             <systemPropertyVariables>
>               
> <settings.localRepository>${settings.localRepository}</settings.localRepository>
>             </systemPropertyVariables>
>           </configuration>
>         </plugin>
> {code}
> With such configuration we always have correct path, not important if
>  - user provide {{-Dmaven.repo.local=}} as Maven build property
>  - user provide custom settings path by {{-s}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to