Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installed as a "tool", could the SLF4J annoyance be taken care of automatically? #108

Open
frou opened this issue Sep 4, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@frou
Copy link

frou commented Sep 4, 2021

https://github.com/liquidz/antq/blob/main/doc/avoid-slf4j-warnings.adoc

Clojure describes tools as:

The Clojure CLI supports the idea of running tools, which are programs that don’t use the project classpath, with the -T exec option. Tools are often (but not exclusively) external, defined with their own dependencies.

So could the antq "tool" be changed to automatically have the org.slf4j/slf4j-nop dependency, without affecting the user's projects?

@liquidz
Copy link
Owner

liquidz commented Sep 4, 2021

@frou I've been looking for the way to avoid annoying message, but haven't found it yet.

As a "library", I don't want to have org.slf4j/slf4j-nop by default, because it effets user side project.

As a "tool", I want to have org.slf4j/slf4j-nop, but currently I cannot specify which aliases to use when installing as "tool".

For "tool", I can create another repository which provides both of antq and slf4j-nop, but I don't want to do this as much as possible because of the extra operational costs.

So If Clojure CLI supports specifying aliases for tool installation, I'd like to deal with it then.

If you have any ideas, PR is very welcomed!

@liquidz liquidz added the enhancement New feature or request label Sep 4, 2021
@frou
Copy link
Author

frou commented Sep 4, 2021 via email

@p-himik
Copy link

p-himik commented Nov 17, 2022

Quoting Alex Miller from https://clojurians.slack.com/archives/C6QH853H8/p1668698984902689:

At the moment, you would need some kind of wrapper for the tool. You could either put that in a separate repo or put it in a subdir and use a git dep with a deps root and a local dep back to the root. I think that should work

You can add :deps/root to point to a subdir of a git dep

Sounds promising.

@liquidz
Copy link
Owner

liquidz commented Nov 17, 2022

@p-himik Thanks for your information!

@hlship
Copy link

hlship commented Sep 26, 2024

A partial solution.

Create an alias in ~/.clojure/deps.edn:

  :slf4j-nop {:extra-deps {org.slf4j/slf4j-nop {:mvn/version "2.0.16"}}}

Then invoke as:

clj -A:slf4j-nop -Tantq outdated

@hlship
Copy link

hlship commented Sep 26, 2024

Or:

clj -Sdeps '{:aliases {:noop {:extra-deps {org.slf4j/slf4j-nop {:mvn/version "2.0.16"}}}}}' -A:noop -Tantq outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants