You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/02/09 15:26:00 UTC
[jira] [Commented] (MNG-6869) New flag to verify the status
[ https://issues.apache.org/jira/browse/MNG-6869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686593#comment-17686593 ]
ASF GitHub Bot commented on MNG-6869:
-------------------------------------
mthmulders opened a new pull request, #995:
URL: https://github.com/apache/maven/pull/995
This pull request adds a few basic checks that users can run to see if they've installed Maven correctly. This includes:
1. A check if the local Maven repository is usable.
2. A check if Maven can connect to remote repositories configured in **settings.xml**.
3. A check if Maven can resolve a pre-existing artifact (to be precise, `org.apache.maven:apache-maven:3.8.6`).
These checks honour **settings.xml** profile activation through `<activeProfiles>`. The artifact resolution check honours any configured mirrors.
The connection check is quite rudimentary, and only functions at the HTTP connection level. Since there is no guarantee that a repository will contain a particular artifact, there's not much more we can do.
The artifact resolution check is a bit more thorough: it checks if there is _any_ way in which Maven can resolve itself. It does so by temporarily using a "dummy" local repository. This is necessary to prevent a "false positive", where the artifact may have existed before.
We have not added unit tests or integration tests (yet). At some level, they may be useful, but we expect a full integration test to be a significant amount of work that would not provide a lot of value. We're curious to hear your opinions about that trade-off.
---
Following this checklist to help us incorporate your contribution quickly and easily:
- [X] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
--> [MNG-6869](https://issues.apache.org/jira/browse/MNG-6869)
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [X] Format the pull request title like `[MNG-XXX] SUMMARY`,
where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue.
- [ ] Also format the first line of the commit message like `[MNG-XXX] SUMMARY`.
Best practice is to use the JIRA issue title in both the pull request title and in the first line of the commit message.
- [X] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [X] You have run the [Core IT][core-its] successfully.
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [X] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
[core-its]: https://maven.apache.org/core-its/core-it-suite/
> New flag to verify the status
> -----------------------------
>
> Key: MNG-6869
> URL: https://issues.apache.org/jira/browse/MNG-6869
> Project: Maven
> Issue Type: New Feature
> Reporter: Robert Scholte
> Assignee: Maarten Mulders
> Priority: Major
>
> While working on INFRA-19861 we had issues with invalid changes in the settings.xml.
> This was detected too late. After installation {{mvn --version}} is called, but it will only show the version of Maven.
> It would be better to have a flag that verifies it a bit more:
> - can Maven read/write to the local repository
> - can Maven access all predefined repositories? (does the proxy work?)
> This gives a much better feedback if Maven can do its job.
> Current workaround: call something like {{mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)