Colm O hEigeartaigh created CXFXJC-54:
-----------------------------------------
Summary: Replace the sonatype plexus-build-api in cxf-xjc-plugin
with org.codehaus.plexus:plexus-build-api
Key: CXFXJC-54
URL: https://issues.apache.org/jira/browse/CXFXJC-54
Project: CXF XJC Utils
Issue Type: Improvement
Reporter: Colm O hEigeartaigh
Fix For: 4.3.0
{{cxf-xjc-plugin}} uses {{org.sonatype.plexus:plexus-build-api:0.0.7}} for
{{{}BuildContext{}}}, which gives incremental builds and error markers in
Eclipse/m2e. That artifact dates from 2012 and is no longer maintained. Its
successor is {{org.codehaus.plexus:plexus-build-api}} 1.x, which provides the
same {{BuildContext}} API under the package {{{}org.codehaus.plexus.build{}}}.
Proposed change:
* In cxf-xjc-plugin/pom.xml, replace
{{org.sonatype.plexus:plexus-build-api:0.0.7}} with
{{{}org.codehaus.plexus:plexus-build-api:1.2.0{}}}.
* Change {{org.sonatype.plexus.build.incremental.BuildContext}} to
{{org.codehaus.plexus.build.BuildContext}} in {{{}AbstractXSDToJavaMojo{}}},
{{{}XSDToJavaRunner{}}}, {{{}XJCErrorListener{}}}, {{XJCBuildContext}} and
{{{}ForkedOutputConsumer{}}}, and in the related tests. No other code changes
are needed.
Version note: use 1.2.0, not 1.3.0. In 1.3.0,
{{org.codehaus.plexus.build.progress.DefaultProgress}} is annotated both
{{@Singleton}} and {{{}@MojoExecutionScoped{}}}. Guice rejects this with
{{DuplicateScopeAnnotations}} when Maven loads the plugin, so every execution
fails with “Unable to load the mojo … NoSuchElementException”. This was
reproduced with Maven 3.9.11. Add a Dependabot ignore entry for 1.3.0 until a
fixed release is available.
Compatibility:
* Maven command line: no change for users. With 1.2.0, the full cxf-xjc-utils
build passes, including the {{*-test}} modules that run the {{xsdtojava}} mojos.
* Eclipse/m2e: m2e 2.x supports the codehaus API directly. For older m2e, the
codehaus {{DefaultBuildContext}} passes calls through to the legacy sonatype
{{BuildContext}} that m2e provides, so incremental builds and error markers
should keep working. This should be checked in Eclipse before release.
* New transitive dependencies: {{{}javax.inject{}}}, {{slf4j-api}} and
{{{}org.eclipse.sisu.plexus{}}}. Maven core already provides all three, so they
aren’t loaded into the plugin’s class realm.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)