René's URL Explorer Experiment


Title: Avoid the fat-slf4j-jar and solve the logging issue in a better way · Issue #202 · git-commit-id/git-commit-id-maven-plugin · GitHub

Open Graph Title: Avoid the fat-slf4j-jar and solve the logging issue in a better way · Issue #202 · git-commit-id/git-commit-id-maven-plugin

X Title: Avoid the fat-slf4j-jar and solve the logging issue in a better way · Issue #202 · git-commit-id/git-commit-id-maven-plugin

Description: Hi @ktoso, before I start working on this issue I wanted to recheck some couple of details. With Issue #191 we got the Request that the plugin ignores MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn I have introduced the slf4j-d...

Open Graph Description: Hi @ktoso, before I start working on this issue I wanted to recheck some couple of details. With Issue #191 we got the Request that the plugin ignores MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLog...

X Description: Hi @ktoso, before I start working on this issue I wanted to recheck some couple of details. With Issue #191 we got the Request that the plugin ignores MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLog...

Opengraph URL: https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/202

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Avoid the fat-slf4j-jar and solve the logging issue in a better way","articleBody":"Hi @ktoso,\nbefore I start working on this issue I wanted to recheck some couple of details.\nWith Issue https://github.com/ktoso/maven-git-commit-id-plugin/issues/191 we got the Request that the plugin ignores `MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn`\nI have introduced the slf4j-dependency with https://github.com/ktoso/maven-git-commit-id-plugin/pull/194.\nHowever we got some class loading issue with some of the maven versions (https://github.com/ktoso/maven-git-commit-id-plugin/issues/196, https://github.com/ktoso/maven-git-commit-id-plugin/issues/198), which we fixed by creating a uber-jar (https://github.com/ktoso/maven-git-commit-id-plugin/pull/197).\n\nI just want to quickly recap what I could figure out during the phase I reported this to Maven (https://issues.apache.org/jira/browse/MNG-5835)\nLet's start with the fact that `MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn mvn clean package` and `mvn clean package -Dorg.slf4j.simpleLogger.defaultLogLevel=warn` are two complete different things :-)\nThe main fact is that the `MavenCli` considers the `-D` arguments passed to Maven after the SLF4J logger has already been initialised.\n\nI think it's better to illustrate this with an example what the original problem was and what this all means:\nLet's start with a simple Mojo just using the `getLog()`-Method for logging.\nThis will take care for `MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn mvn clean package`. However it will ignore the `-D` arguments passed to Maven (so it will ignore `mvn clean package -Dorg.slf4j.simpleLogger.defaultLogLevel=warn`).\n`java\n// plugin one\npublic void execute() {\n    getLog().info(\"Info-Message: Hello, world.\");\n}\n`\nLet's now move to a simple Mojo that create the `getLog()` outside the execute and will store it as a variable (that was the way the git-commit-id-plugin had done it's logging). The Problem here as outline in (https://issues.apache.org/jira/browse/MNG-5835)\n`\nIf you call getLog() in your constructor then you'll get an instance of SystemStreamLog that unconditionally logs to System.out. Your mojo will be wired with an SLF4J-backed logger after construction.\nCall getLog() during the execute() method, and don't cache the value.\n`\nSo in general this will ignore `MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn mvn clean package` (as reported). It will also ignore the `-D` arguments passed to Maven (so it will ignore `mvn clean package -Dorg.slf4j.simpleLogger.defaultLogLevel=warn`).\n\n`java\n// plugin two\nprivate final Log logger = getLog();\npublic void execute() {\n    logger.info(\"Info-Message: Hello, world.\");\n}\n`\n\nWe currently have the third option available on the market.\nIt used the  the slf4-dependencies and wires itself to the slfj-simple-logger.\nOur current solution takes care for `MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLogLevel=warn mvn clean package` and also takes care of `-D` arguments passed to Maven (so it will NOT ignore `mvn clean package -Dorg.slf4j.simpleLogger.defaultLogLevel=warn`).\n\nThe essence is if there is no one is using the  `mvn clean package -Dorg.slf4j.simpleLogger.defaultLogLevel=warn`-Option we can just drop the fat-slf4j-jar and the dependencies to slf4j and will let `getLog` take care of the rest. However also outline in https://issues.apache.org/jira/browse/MNG-5835 it may be a bad idea to store to logger somewhere (in the LoggerBridge). I currently don't have a valid reason why not saving it somewhere, but this somehow we definitely need to test.\nQuestions/comments are welcome :-)\n","author":{"url":"https://github.com/TheSnoozer","@type":"Person","name":"TheSnoozer"},"datePublished":"2015-06-16T08:59:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/202/git-commit-id-maven-plugin/issues/202"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6b20ce6c-240c-63fe-f0eb-3dfe5304272b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB3A0:26FDC0:6EB12D:8C84E0:699004ED
html-safe-noncec23a06fa4547bc25346e34b7bee42ea51ec972af7897d69800ee8674c7d75fa0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0EwOjI2RkRDMDo2RUIxMkQ6OEM4NEUwOjY5OTAwNEVEIiwidmlzaXRvcl9pZCI6IjgyMjYzMzE1NjkwMTM0MDM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0888449876cd62ef1becda140379031d7479b5caaf41d90cdae38f6b190a7b57
hovercard-subject-tagissue:88664766
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/git-commit-id/git-commit-id-maven-plugin/202/issue_layout
twitter:imagehttps://opengraph.githubassets.com/16ba413435fbdd0553b1b9a2bc3859ec3ffb51701f90495b9ec2ed64079ba233/git-commit-id/git-commit-id-maven-plugin/issues/202
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/16ba413435fbdd0553b1b9a2bc3859ec3ffb51701f90495b9ec2ed64079ba233/git-commit-id/git-commit-id-maven-plugin/issues/202
og:image:altHi @ktoso, before I start working on this issue I wanted to recheck some couple of details. With Issue #191 we got the Request that the plugin ignores MAVEN_OPTS=-Dorg.slf4j.simpleLogger.defaultLog...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameTheSnoozer
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/git-commit-id/git-commit-id-maven-plugin git https://github.com/git-commit-id/git-commit-id-maven-plugin.git
octolytics-dimension-user_id43124426
octolytics-dimension-user_logingit-commit-id
octolytics-dimension-repository_id1361792
octolytics-dimension-repository_nwogit-commit-id/git-commit-id-maven-plugin
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1361792
octolytics-dimension-repository_network_root_nwogit-commit-id/git-commit-id-maven-plugin
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues/202#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgit-commit-id%2Fgit-commit-id-maven-plugin%2Fissues%2F202
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgit-commit-id%2Fgit-commit-id-maven-plugin%2Fissues%2F202
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=git-commit-id%2Fgit-commit-id-maven-plugin
Reloadhttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues/202
Reloadhttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues/202
Reloadhttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues/202
git-commit-id https://patch-diff.githubusercontent.com/git-commit-id
git-commit-id-maven-pluginhttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fgit-commit-id%2Fgit-commit-id-maven-plugin
Fork 302 https://patch-diff.githubusercontent.com/login?return_to=%2Fgit-commit-id%2Fgit-commit-id-maven-plugin
Star 1.7k https://patch-diff.githubusercontent.com/login?return_to=%2Fgit-commit-id%2Fgit-commit-id-maven-plugin
Code https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin
Issues 25 https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues
Pull requests 6 https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/pulls
Actions https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/actions
Projects 0 https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/projects
Security 0 https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/security
Insights https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/pulse
Code https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin
Issues https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues
Pull requests https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/pulls
Actions https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/actions
Projects https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/projects
Security https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/security
Insights https://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/202
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/202
Avoid the fat-slf4j-jar and solve the logging issue in a better wayhttps://patch-diff.githubusercontent.com/git-commit-id/git-commit-id-maven-plugin/issues/202#top
2.2.1https://github.com/git-commit-id/git-commit-id-maven-plugin/milestone/19
https://github.com/TheSnoozer
https://github.com/TheSnoozer
TheSnoozerhttps://github.com/TheSnoozer
on Jun 16, 2015https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/202#issue-88664766
@ktosohttps://github.com/ktoso
#191https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/191
#194https://github.com/git-commit-id/git-commit-id-maven-plugin/pull/194
#196https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/196
#198https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/198
#197https://github.com/git-commit-id/git-commit-id-maven-plugin/pull/197
https://issues.apache.org/jira/browse/MNG-5835https://issues.apache.org/jira/browse/MNG-5835
https://issues.apache.org/jira/browse/MNG-5835https://issues.apache.org/jira/browse/MNG-5835
https://issues.apache.org/jira/browse/MNG-5835https://issues.apache.org/jira/browse/MNG-5835
2.2.1https://github.com/git-commit-id/git-commit-id-maven-plugin/milestone/19
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.