Skip to content

Conversation

@Jayant-kernel
Copy link

@Jayant-kernel Jayant-kernel commented Jan 15, 2026

Fixes #4576

Problem

ScanCode wasn't detecting the BSD-3-Clause license in JLine packages (jline-console, jline-style, jline-reader) because the license is in XML comments instead of the usual Maven tags.
Solution
Added a detection rule bsd-new_jline_xml.RULE to catch the BSD license pattern used in JLine POM files.
Testing
Tested on jline-console-3.30.4-sources.jar:

License detected: BSD-3-Clause
Rule used: bsd-new_jline_xml.RULE

The same pattern shows up in jline-style and jline-reader, so this covers all three packages.

Changes

Added src/licensedcode/data/rules/bsd-new_jline_xml.RULE with proper metadata fields for copyright, holders, and URLs per maintainer feedback.
The license appears in POM files as:
xml
ScanCode now picks this up correctly.

Checklist:
Reviewed contribution guidelines
PR links to original issue
Tests pass
Feature branch with no merge conflicts
Updated CHANGELOG.rst (if needed)

Signed-off-by: Jayant Saxena jayantmcom@gmail.com

@Jayant-kernel
Copy link
Author

Jayant-kernel commented Jan 16, 2026

@Kannan-3757
i hace done the fixing

The original issue (BSD license not detected in JLine packages) is now resolved. The test_ignorables_in_rule_or_license_bsd_new_jline_xml validation test is passing.

The current CI failure in 3.14 - misc_and_scancode is unrelated to this PR:

  • Error: ValueError: signal only works in main thread in test_interrupt.py
  • This is a Python 3.14 compatibility issue in the test framework
  • My changes only added one license rule file

The BSD license detection for JLine packages is working as required and is ready for review..

@Jayant-kernel
Copy link
Author

Summary: Adds BSD license detection for JLine packages where the license is declared in XML comments instead of standard Maven <licenses> tags.

Status:
All validation tests passing
Verified working on actual JLine package (jline-console-3.30.4-sources.jar)
Follows existing rule patterns

The CI failure in test_interrupt.py appears to be a Python 3.14 compatibility issue unrelated to this PR (my changes only add one rule file).

@pombredanne @AyanSinhaMahapatra - Ready for review when you have time!

Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jayant-kernel see comments for your consideration

Appears in jline-console, jline-style, and jline-reader modules.
---

Copyright (c) 2002-2020, the original author or authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the copyright line? This is not useful for the license rule

---

Copyright (c) 2002-2020, the original author or authors.
This software is distributable under the BSD license. See the terms of the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This software is distributable under the BSD license. See the terms of the
This software is {{distributable under the BSD license}}. See the terms of the

Use required phrases whenever applicable to reduce false positives.

Copyright (c) 2002-2020, the original author or authors.
This software is distributable under the BSD license. See the terms of the
BSD license in the documentation provided with this software.
https://opensource.org/licenses/BSD-3-Clause
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
https://opensource.org/licenses/BSD-3-Clause
{{https://opensource.org/licenses/BSD-3-Clause}}

Same as above

@Jayant-kernel
Copy link
Author

@AyanSinhaMahapatra
Thanks for the review I've fixed the rule format:

Put the copyright line in ignorable_copyrights instead of the rule body
Added ignorable_holders for the holder info
Moved the URL to ignorable_urls

Should be good now!

Jayant-kernel added a commit to Jayant-kernel/scancode-toolkit that referenced this pull request Jan 29, 2026
Add proper BSD detection rule for JLine style XML comments. Detects BSD-3-Clause in POM files. Includes validation fixes and correct metadata fields.

Signed-off-by: Jayant Saxena <jayantmcom@gmail.com>
@Jayant-kernel Jayant-kernel force-pushed the fix-4576-bsd-license-detection branch from 7618315 to 3775292 Compare January 29, 2026 05:57
Jayant-kernel added a commit to Jayant-kernel/scancode-toolkit that referenced this pull request Jan 29, 2026
Add proper BSD detection rule for JLine style XML comments. Detects BSD-3-Clause in POM files. Includes validation fixes and correct metadata fields.

Signed-off-by: Jayant Saxena <jayantmcom@gmail.com>
@Jayant-kernel Jayant-kernel force-pushed the fix-4576-bsd-license-detection branch from 3775292 to 798d94d Compare January 29, 2026 05:59
Add proper BSD detection rule for JLine style XML comments. Detects BSD-3-Clause in POM files. Includes validation fixes and correct metadata fields.

Signed-off-by: Jayant Saxena <jayantmcom@gmail.com>
@Jayant-kernel Jayant-kernel force-pushed the fix-4576-bsd-license-detection branch from 798d94d to 8678202 Compare January 29, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to scan BSD license

2 participants