Skip to content

Conversation

@amirkaveh
Copy link

Maven POM Modernization and Security Fixes

Background

While attempting to use org.mp4parser:isoparser:1.9.56 as a dependency, security scanners flagged multiple vulnerabilities in its transitive dependencies. This PR addresses those vulnerabilities and modernizes the build configuration.

Security Vulnerabilities Addressed

CVE Severity Library Description Fix
CVE-2021-29425 Medium (5.3) commons-io < 2.7 Path traversal via FileNameUtils.normalize() Upgraded to 2.21.0
CVE-2024-47554 Medium (5.3) commons-io < 2.14.0 DoS via XmlStreamReader CPU exhaustion Upgraded to 2.21.0
CVE-2020-15250 Medium (5.5) junit < 4.13.1 Information disclosure via TemporaryFolder Migrated to JUnit 5.14.1

Dependency Upgrades

Dependency Before After
JUnit 4.12 5.14.1 (migrated all tests)
Commons IO 2.5 2.21.0
Commons Codec 1.10 1.20.0
SLF4J 1.8.0-beta4 2.0.17
AspectJ 1.9.7 1.9.7 (unchanged)

Plugin Upgrades

Plugin Before After
maven-source-plugin 3.0.1 3.3.1
maven-javadoc-plugin 3.1.1 / 3.4.0 3.12.0
maven-gpg-plugin 1.5 / 1.6 3.2.8
maven-resources-plugin 3.1.0 3.3.1
maven-compiler-plugin 3.8.1 3.14.1
maven-release-plugin 3.0.0-M5 3.1.1
maven-dependency-plugin 3.3.0 3.8.1
aspectj-maven-plugin 1.14.0 1.15.0
nexus-staging-maven-plugin 1.6.13 1.7.0

Structural Improvements

Centralized Dependency Management

  • Added <dependencyManagement> in parent POM for all shared dependencies
  • Introduced junit-bom for consistent JUnit version management
  • Child POMs now inherit versions from parent (removed all hardcoded versions)
  • Fixed inter-module dependencies to use ${project.version} instead of hardcoded 1.9.57-SNAPSHOT

Centralized Plugin Management

  • Created version properties for all dependencies and plugins
  • Removed duplicate plugin declarations (maven-source-plugin, maven-javadoc-plugin were declared twice)
  • Consolidated inconsistent plugin versions (maven-gpg-plugin had 1.5 and 1.6)

Fixed AspectJ Configuration

  • Changed complianceLevel/source/target from 9 to 1.8 (was inconsistent with Java 8 target)
  • Fixed typo in module-path: slf4-api.jarslf4j-api.jar

Cleanup

  • Removed deprecated <prerequisites> tag
  • Removed duplicate metadata from child POMs (<licenses>, <developers>, <scm>, <url>, <groupId>, <properties>)
  • Removed duplicate release-sign-artifacts profile from streaming module
  • Updated stale SCM tag: mp4parser-project-1.9.43HEAD

Results

  • ✅ All 169 tests passing
  • ✅ Single source of truth for all versions
  • ✅ Java 8 compatibility maintained

Not Addressed

Warning

nexus-staging-maven-plugin still references OSSRH (https://oss.sonatype.org/) which shut down June 2025. A separate migration to central-publishing-maven-plugin is required for Maven Central publishing.

change pom configs so that project can be compiled with java 8
upgrade commons-io from 2.5 to 2.21.0 due to multiple vulnerabilities
upgrade JUnit from 4.12 to 5.14.1 due to multiple vulnerabilities
upgrade slf4j-api from 1.8.0-beta4 to 2.0.17
upgrade slf4j-simple from 1.8.0-beta4 to 2.0.17
upgrade commons-codec from 1.10 to 1.20.0
upgrade maven-compiler-plugin from 3.8.1 to 3.14.1
upgrade maven-source-plugin from 3.0.1 to 3.3.1
upgrade maven-javadoc-plugin from 3.4.0 to 3.12.0
upgrade maven-gpg-plugin from 1.6 to 3.2.8
upgrade maven-resources-plugin from 3.1.0 to 3.3.1
upgrade maven-release-plugin from 3.0.0-M5 to 3.1.1
upgrade maven-dependency-plugin from 3.3.0 to 3.8.1
upgrade nexus-staging-maven-plugin from 1.6.13 to 1.7.0
upgrade aspectj-maven-plugin from 1.14.0 to 1.15.0
Parent POM changes:
- Remove deprecated <prerequisites> tag
- Add version properties for all dependencies and plugins
- Add to dependencyManagement: aspectjrt, aspectjtools, commons-io, commons-codec
- Add to pluginManagement: maven-dependency-plugin, aspectj-maven-plugin
- Update SCM tag from 'mp4parser-project-1.9.43' to 'HEAD'

Child POM changes:
- Remove redundant elements inherited from parent:
  - <groupId>, <url>, <properties>, <licenses>, <developers>, <scm>
- Remove hardcoded dependency versions (now managed by parent)
- Remove hardcoded plugin versions (now managed by parent)
- Remove duplicate 'release-sign-artifacts' profile from streaming
- Remove <defaultGoal> from isoparser (inherited from parent)
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.

1 participant