patrodyne / hisrc-higherjaxb

The most advanced JAXB Maven Plugin for XJC (XML Schema compilation).
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Warning with Maven 3.9.1 #2

Closed huxi closed 7 months ago

huxi commented 1 year ago

The following warning is currently displayed when using hisrc-higherjaxb40-maven-plugin 2.1.0 with Maven 3.9.1:

[WARNING] Parameter 'localRepository' is deprecated core expression; Avoid use of ArtifactRepository type. If you need access to local repository, switch to '${repositorySystemSession}' expression and get LRM from it instead.

This issue is just meant to inform you in case you aren't aware yet. Everything still works fine.

Thanks for your effort!

patrodyne commented 1 year ago

Thank you for reporting the warning. I'll review before the next release.

patrodyne commented 1 year ago

I have updated my Maven to v3.9.3 and performed a full rebuild, unit and integration test of the Patrodyne HiSrc projects. I did not see the warning but I am not surprised that it may appear. The HiSrc HigherJAXB project uses the maven-compat Maven2 compatibility layer. At some point, the project will need to be updated to use the current Maven APIs. Note: The tricky part is that the HiSrc HigherJAXB plugin uses the Maven API to resolve XJC plugins; thus, it acts like a mini-maven. It was implemented in the Maven 2.X era when the transport layer was very different and the HigherJAXB XJC resolver has been minimally maintained until now. Methinks, I'll be diving deep into it sometime in the next year.

Per Apache Maven JIRA MNG-7706:

If a Mojo gets this WARNING, how should it be fixed?

Presence of parameter ${localRepository} (with presence of type ArtifactReposiory) usually means following things: Mojo uses maven-compat Maven2 compatibility layer, OR uses some deprecated libraries (most prominent example is maven-artifact-transfer). Both are technical debts, and remedy is to switch code to use current APIs.

If a user is stuck with a plugin that issues this warning, the user still can use it, but should avoid use of any advanced (split, etc) local repository features, available since 3.9.0. Inevitably, the deprecated APIs (maven-compat, etc) will get removed in the future.

patrodyne commented 9 months ago

Release v2.2.0 of the HiSrc HigherJAXB Maven plugin has been refactored to eliminate the deprecated maven-compat dependency in favor of the Maven Resolver/Aether dependencies.