feat: Add Maven parent POM license resolution (v1.6.0)#29
Merged
oscarvalenzuelab merged 4 commits intomainfrom Nov 14, 2025
Merged
feat: Add Maven parent POM license resolution (v1.6.0)#29oscarvalenzuelab merged 4 commits intomainfrom
oscarvalenzuelab merged 4 commits intomainfrom
Conversation
…ckage
PROBLEM:
Maven packages often declare licenses in parent POMs rather than in the
package POM itself. The download_and_scan_package tool would return no
license information for such packages even though the license exists.
SOLUTION:
Added Maven-specific license resolution using upmex with --registry and
--api clearlydefined flags to query ClearlyDefined, which resolves parent
POM licenses automatically.
WORKFLOW ENHANCEMENT:
After scanning a Maven package (pkg:maven/...), if no license is found:
1. Detects it's a Maven package (purl.startswith('pkg:maven/'))
2. Calls upmex extract with --registry --api clearlydefined flags
3. ClearlyDefined API resolves parent POM licenses
4. Updates result with license and license_source = 'parent_pom_via_clearlydefined'
CHANGES:
- mcp_semclone/server.py:
* Added Maven package detection (line 2059)
* Added parent POM resolution logic (lines 2060-2078)
* Updated tool docstring with Maven-specific behavior
- mcp_semclone/__init__.py: Bump version 1.5.8 → 1.5.9
- pyproject.toml: Bump version 1.5.8 → 1.5.9
- examples/strands-agent-ollama/requirements.txt: Update dependency
- CHANGELOG.md: Document Maven parent POM enhancement
- tests/test_server.py: Add test_maven_parent_pom_resolution
TESTING:
✅ All 6 download_and_scan_package tests pass
✅ New test verifies parent POM resolution workflow
✅ Confirms upmex called twice (normal + with --registry --api)
✅ Validates license_source metadata tracking
IMPACT:
✅ Maven packages now correctly report licenses from parent POMs
✅ Automatic detection - no user configuration needed
✅ Transparent tracking with license_source field
✅ Graceful fallback if parent POM resolution fails
USER FEEDBACK:
User identified that Maven packages without declared licenses should use
upmex parent POM feature to resolve licenses from parent POMs.
ENHANCEMENT:
Improved Maven parent POM resolution to properly combine licenses found in:
1. Source file headers (detected by osslili)
2. Maven parent POM (resolved via ClearlyDefined)
CHANGES:
- mcp_semclone/server.py:
* Added detailed comment explaining 3 license sources
* Parent POM license now added to detected_licenses list
* Enhanced logging showing combined licenses
* Improved scan_summary to indicate parent POM source
* Better summary generation with multiple parts
- tests/test_server.py:
* Added test_maven_combined_source_and_parent_pom_licenses
* Verifies both source headers and parent POM licenses are detected
* Confirms both appear in detected_licenses list
* Validates summary mentions parent POM
EXAMPLE:
Maven package with MIT in source headers + Apache-2.0 in parent POM:
{
"declared_license": "Apache-2.0", # From parent POM
"detected_licenses": ["MIT", "Apache-2.0"], # Both sources
"metadata": {
"license_source": "parent_pom_via_clearlydefined"
},
"scan_summary": "Deep scan completed. found 2 licenses. (includes parent POM license). 1 copyrights."
}
TESTING:
✅ All 7 download_and_scan_package tests pass
✅ New test verifies license combination
✅ Confirms parent POM license added to detected_licenses
USER FEEDBACK:
User noted: "sometimes when license is not detect in the metadata or as
license file, the license could also be in the source header of files, or
in maven, in the parent pom, consider both"
… detection Updated v1.5.9 changelog to clarify that the tool now checks: 1. Source file headers (osslili) 2. Package POM (upmex) 3. Parent POM (upmex with --registry --api clearlydefined) Added two example scenarios: 1. License only in parent POM 2. Licenses in BOTH source headers AND parent POM Expanded Changes and Impact sections to reflect full functionality.
Contributor
Author
Enhancement UpdateAdded comprehensive handling of licenses from multiple sources for Maven packages: Three License Sources Now Checked
New BehaviorCombines licenses from all sources:
Example OutputMaven package with MIT in source headers + Apache-2.0 in parent POM: {
"declared_license": "Apache-2.0",
"detected_licenses": ["MIT", "Apache-2.0"],
"metadata": {
"license_source": "parent_pom_via_clearlydefined"
},
"scan_summary": "Deep scan completed. found 2 licenses. (includes parent POM license). 1 copyrights."
}TestingAdded new test: All 7 tests pass: User Feedback Addressed
✅ Now considers both source headers AND parent POM |
Maven parent POM resolution is a significant new feature, so using a minor version bump (1.6.0) instead of patch (1.5.9) to better follow semantic versioning conventions. CHANGES: - mcp_semclone/__init__.py: 1.5.9 → 1.6.0 - pyproject.toml: 1.5.9 → 1.6.0 - examples/strands-agent-ollama/requirements.txt: 1.5.9 → 1.6.0 - CHANGELOG.md: Updated [1.5.9] → [1.6.0] and section from 'Enhanced' to 'Added' - CHANGELOG.md: Updated example comment from v1.5.9 → v1.6.0 REASONING: - v1.5.8: Critical bugfix + redesign - v1.6.0: New feature (Maven parent POM resolution) - Minor version bump signals new functionality vs patch-level fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement
Add Maven-specific license resolution to handle packages where licenses are declared in parent POMs rather than in the package POM itself.
Problem
Maven packages often don't declare licenses directly in their package POM - the license is declared in a parent POM instead. When
download_and_scan_packageanalyzed such packages, it would return no license information even though the license exists in the parent POM.Example:
Solution
Added Maven-specific license resolution using upmex's
--registryand--api clearlydefinedflags to query ClearlyDefined API, which automatically resolves parent POM licenses.Workflow Enhancement
After scanning a Maven package (pkg:maven/...), if no license is found:
purl.startswith('pkg:maven/'))upmex extractwith--registry --api clearlydefinedflagslicense_source = 'parent_pom_via_clearlydefined'Code Example
Changes
mcp_semclone/server.py
Added Maven parent POM resolution (lines 2057-2078):
Updated tool docstring - Added Maven-specific documentation
Version Updates
mcp_semclone/__init__.py: 1.5.8 → 1.5.9pyproject.toml: 1.5.8 → 1.5.9examples/strands-agent-ollama/requirements.txt: 1.5.8 → 1.5.9CHANGELOG.md
Documented Maven parent POM enhancement with examples and impact
tests/test_server.py
Added
test_maven_parent_pom_resolution:Testing
Results:
Impact
✅ Maven packages now correctly report licenses from parent POMs
✅ Automatic detection - no user configuration needed
✅ Transparent tracking with
license_sourcefield✅ Graceful fallback if parent POM resolution fails
✅ Zero breaking changes - fully backward compatible
User Feedback
User identified the issue:
This enhancement directly addresses that feedback by automatically resolving parent POM licenses for Maven packages.
Release
Version: 1.5.9
Type: Enhancement
Breaking Changes: None