[MRESOLVER-291] Undo params use (#219)

Pull out ctor param injection, provide generic enough helper to allow anyone to customize as they want.

Changes in short: 
Nor SyncContextFactory nor NamedLockFactoryAdapter should shut down. This was the problem, and I was mislead by it. NamedLockFactory instances are **singletons**, and **are inited in ctor**. Hence, if two adapters used same factory, in case one adapter is shut down, it would shut down the lock factory of the other one as well (unexpectedly). Hence, it is solely the adapter factory duty to shut down factories, but again, as we saw, they are inited in ctor, hence if we assume there is living HZ named lock factory, even if unused (as file lock is used for example), shutdown is still needed, to shut down the HZ instance (same applies to Redisson btw)! All in all, this new class is IMHO the most correct, while it allows overriding and changing things, if needed.

Minor: do not create static initializers to be used in SL, make them methods invoked when needed.

---

https://issues.apache.org/jira/browse/MRESOLVER-291
11 files changed
tree: a2d1563415b36ab626cfa522117bed7f2fdf0d2f
  1. .github/
  2. maven-resolver-api/
  3. maven-resolver-connector-basic/
  4. maven-resolver-demos/
  5. maven-resolver-impl/
  6. maven-resolver-named-locks/
  7. maven-resolver-named-locks-hazelcast/
  8. maven-resolver-named-locks-redisson/
  9. maven-resolver-spi/
  10. maven-resolver-test-util/
  11. maven-resolver-transport-classpath/
  12. maven-resolver-transport-file/
  13. maven-resolver-transport-http/
  14. maven-resolver-transport-wagon/
  15. maven-resolver-util/
  16. src/
  17. .asf.yaml
  18. .gitignore
  19. class-overview.svg
  20. Jenkinsfile
  21. pom.xml
  22. README.md
README.md

Contributing to Apache Maven Artifact Resolver

ASF Jira Apache License, Version 2.0, January 2004 Maven Central Reproducible Builds Jenkins Status Jenkins tests

You have found a bug or you have an idea for a cool new feature? Contributing code is a great way to give something back to the open source community. Before you dig right into the code, there are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

Getting Started

  • Make sure you have a JIRA account.
  • Make sure you have a GitHub account.
  • If you‘re planning to implement a new feature, it makes sense to discuss your changes on the dev list first. This way you can make sure you’re not wasting your time on something that isn‘t considered to be in Apache Maven’s scope.
  • Submit a ticket for your issue, assuming one does not already exist.
    • Clearly describe the issue, including steps to reproduce when it is a bug.
    • Make sure you fill in the earliest version that you know has the issue.
  • Fork the repository on GitHub.

Making and Submitting Changes

We accept Pull Requests via GitHub. The developer mailing list is the main channel of communication for contributors. There are some guidelines which will make applying PRs easier for us:

  • Create a topic branch from where you want to base your work (this is usually the master branch). Push your changes to a topic branch in your fork of the repository.
  • Make commits of logical units.
  • Respect the original code style: by using the same codestyle, patches should only highlight the actual difference, not being disturbed by any formatting issues:
    • Only use spaces for indentation.
    • Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted, create a separate PR for this change.
    • Check for unnecessary whitespace with git diff --check before committing.
  • Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
[MRESOLVER-XXX] - Subject of the JIRA Ticket
 Optional supplemental description.
  • Make sure you have added the necessary tests (JUnit/IT) for your changes.
  • Run all the tests with mvn -Prun-its verify to assure nothing else was accidentally broken.
  • Submit a pull request to the repository in the Apache organization.
  • Update your JIRA ticket and include a link to the pull request in the ticket.

If you plan to contribute on a regular basis, please consider filing a contributor license agreement.

Making Trivial Changes

For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA. In this case, it is appropriate to start the first line of a commit with ‘(doc)’ instead of a ticket number.

Additional Resources