maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MENFORCER-319) UTF-8 BOM in pom.xml breaks banDuplicatePomDependencyVersions rule
Date Wed, 14 Nov 2018 11:19:00 GMT

    [ https://issues.apache.org/jira/browse/MENFORCER-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16686382#comment-16686382
] 

ASF GitHub Bot commented on MENFORCER-319:
------------------------------------------

wilx commented on issue #45: [MENFORCER-319] Handle UTF-8 BOM when parsing pom.xml files
URL: https://github.com/apache/maven-enforcer/pull/45#issuecomment-438628257
 
 
   [**@khmarbaise**](https://github.com/khmarbaise) commented on [14 Nov 2018, 00:59 CET](https://github.com/apache/maven-enforcer/pull/45#issuecomment-438485075
"2018-11-13T23:59:34Z - Replied by Github Reply Comments"):
   > The patch looks good so far but unfortunately I don't see a test case for that..
   
   I have updated pom.xml of integration test of banDuplicatePomDependencyVersions rule to
be in UTF-8 BOM encoding.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> UTF-8 BOM in pom.xml breaks banDuplicatePomDependencyVersions rule
> ------------------------------------------------------------------
>
>                 Key: MENFORCER-319
>                 URL: https://issues.apache.org/jira/browse/MENFORCER-319
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>          Components: Standard Rules
>    Affects Versions: 3.0.0-M2
>            Reporter: Václav Haisman
>            Priority: Major
>         Attachments: Handle_parsing_of_pom_xml_in_BanDuplicatePomDependencyVersions_java_similarly_to_how_actua.patch,
pom.xml
>
>
> Having UTF-8 BOM at the beginning of {{pom.xml}} causes the banDuplicatePomDependencyVersions
rule to fail to parse the file with the following exception being shown by {{-X}} output:
> {noformat}
> [DEBUG] Adding failure due to exception
> org.apache.maven.enforcer.rule.api.EnforcerRuleException: Unable to retrieve the MavenProject:
>     at org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions.execute (BanDuplicatePomDependencyVersions.java:87)
>     at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:194)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
>     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
>     at java.lang.reflect.Method.invoke (Unknown Source)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
> Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: only whitespace
content allowed before start tag and not \uef (position: START_DOCUMENT seen \uef... @1:1)
>     at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog (MXParser.java:1862)
>     at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl (MXParser.java:1698)
>     at org.codehaus.plexus.util.xml.pull.MXParser.next (MXParser.java:1317)
>     at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read (MavenXpp3Reader.java:3856)
>     at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read (MavenXpp3Reader.java:595)
>     at org.apache.maven.model.io.xpp3.MavenXpp3Reader.read (MavenXpp3Reader.java:609)
>     at org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions.execute (BanDuplicatePomDependencyVersions.java:75)
>     at org.apache.maven.plugins.enforcer.EnforceMojo.execute (EnforceMojo.java:194)
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
>     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
>     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
>     at java.lang.reflect.Method.invoke (Unknown Source)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
> [WARNING] Rule 0: org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions
failed with message:
> Unable to retrieve the MavenProject:
> {noformat}
> See attached {{pom.xml}} for minimal example.
> Attached patch changes the parsing to be compatible with UTF-8 BOM and fixes the issue
for me.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message