Improve error message when using 3.x with 1.x changes.xml file
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system
Research direction
Start in ChangesXML.java and follow the parsing path through ChangesXpp3Reader.parseAction, using the reported 1.x changes.xml example as a reproduction. Check how the referenced namespace is read and how parse failures are wrapped. Done means an unsupported Changes file version produces an explicit, version-related error instead of the generic XML parser message.
Written by the indexing model from the issue text.
Description
New feature, improvement proposal
I received the following confusing error message when using my old changes file (sticking to https://maven.apache.org/xsd/changes-1.0.0.xsd)
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.21.0:site (default-site) on project ...: Failed to render site: Error generating maven-changes-plugin:3.0.0-M3:changes-report report: An error occurred when parsing the changes.xml file: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ... Deleted the erroneous code.\n <fixes issue="MCHANGES-1"/>... @38:36) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.21.0:site (default-site) on project different-doxia-versions: Failed to render site
...
Caused by: org.apache.maven.plugins.changes.ChangesXMLRuntimeException: An error occurred when parsing the changes.xml file
at org.apache.maven.plugins.changes.ChangesXML.<init> (ChangesXML.java:100)
at org.apache.maven.plugins.changes.ChangesReport.getChangesFromFile (ChangesReport.java:372)
at org.apache.maven.plugins.changes.ChangesReport.executeReport (ChangesReport.java:216)
at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:358)
at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:199)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:302)
at org.apache.maven.plugins.site.render.SiteMojo.renderNonDoxiaDocuments (SiteMojo.java:282)
at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:147)
at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:112)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:919)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:285)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:207)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
at java.lang.reflect.Method.invoke (Method.java:580)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: TEXT must be immediately followed by END_TAG and not START_TAG (position: START_TAG seen ... Deleted the erroneous code.\n <fixes issue="MCHANGES-1"/>... @38:36)
at org.codehaus.plexus.util.xml.pull.MXParser.nextText (MXParser.java:1108)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.parseAction (ChangesXpp3Reader.java:747)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.parseRelease (ChangesXpp3Reader.java:1098)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.parseBody (ChangesXpp3Reader.java:827)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.parseChangesDocument (ChangesXpp3Reader.java:880)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.read (ChangesXpp3Reader.java:606)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.read (ChangesXpp3Reader.java:637)
at org.apache.maven.plugins.changes.model.io.xpp3.ChangesXpp3Reader.read (ChangesXpp3Reader.java:668)
at org.apache.maven.plugins.changes.ChangesXML.<init> (ChangesXML.java:74)
It would be nice to have a more explicit error message which derives from the referenced namespace that the issue is caused by a non supported Changes file version.
- Dominant language
- Java
- Stars
- 15
- Forks
- 22
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-changes-plugin
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
apache/maven-changes-plugin#650 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
apache/maven-changes-plugin#619 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/maven-changes-plugin#610 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
apache/maven-changes-plugin#608 ·
-
NullPointerException: Cannot invoke "java.lang.CharSequence.toString()" because "target" is nullOpenbug
Difficulty 3/5 1-2 days Newbie friendliness 52/100
apache/maven-changes-plugin#130 · 1 comment ·
All issues in apache/maven-changes-plugin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
grimmory-tools/grimmory#2850 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
aoqia194/leaf-loader#19 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/streampark#4521 ·
-
Update license yearOpen0 - Backlog 1 - Ready documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100