apache / apache/maven-verifier
[MSHARED-1147] Inconsistent for settingsFile argument - Maven local repository detecting
- Dominant language
- Java
- Stars
- 6
- Forks
- 17
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
**[Slawomir Jaranowski](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=slawekjaranowski)** opened **[MSHARED-1147](https://issues.apache.org/jira/browse/MSHARED-1147?redirect=false)** and commented
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 $HOME/`{}.m2/settings.xml{`} - can be different set by `-s` options
# 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:
```java
org.apache.maven.plugins
maven-surefire-plugin
${settings.localRepository}
```
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`
---
**Issue Links:**
- [MSHARED-1414](https://issues.apache.org/jira/browse/MSHARED-1414) Verifier.retrieveLocalRepo() does not support interpolation
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the constructors that accept settingsFile and the local-repository detection paths, including setLocalRepo/getLocalRepository and the get, delete, and verifyArtifact methods. Review the linked MSHARED-1414 issue, then define completion as removing the settingsFile dependency, supporting settings.localRepository, and failing when no repository path is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100