Maven 2 & 3

Barfs at attribues named .*encoding

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.0.8
  • Fix Version/s: 2.0.9
  • Component/s: POM::Encoding
  • Labels:
    None
  • Number of attachments :
    2

Description

With 2.0.8 a regression snuck in:

Please see attached pom for details.

In several of my project I use xdoclet-maven-plugin. In xdoclet-maven-plugin's configuration element there is an element, with an attribute xmlencoding="${variable}" (installed into my repository - NOT talking about building them).

If maven tries to read these pom's (from my repo) it barfs with an error message:
"
Project ID: some.group.id:myproject-war

Reason: Failed to build model from file 'c:\data\.m2\repository\some\group\id\myproject-war\1.3-SNAPSHOT\myproject-war-1.3-SNAPSHOT.pom'.
Error: '${ENCODING.DEFAULT}' for project some.group.id:myproject-war .
"

This did NOT happen before 2.0.8 - so it must be a regression.

What really puzzles me is why maven tries to parse these tags in the first place (as they are configurations for elements which should be of no value for this maven execution) - but I guess it was introduced when fixing MNG-2932, MNG-2025 and/or MNG-2254 without knowing any details.

As 2.0.8 fails the entire build (which works on 2.0.7) I'm rating this as Blocker.

  1. examplepom.xml
    11/Dec/07 7:16 AM
    4 kB
    David J. M. Karlsen
  2. pom.xml
    08/Jan/08 6:50 PM
    2 kB
    David J. M. Karlsen

Issue Links

Activity

Hide
David J. M. Karlsen added a comment -

It should also be noted that if I remote the element containing the xmlencoding attribute the build will succeed.

Show
David J. M. Karlsen added a comment - It should also be noted that if I remote the element containing the xmlencoding attribute the build will succeed.
Hide
Herve Boutemy added a comment -

can you attach pom.xml for some.group.id:myproject-war?
I suppose it starts with

<?xml version="1.0" encoding="${ENCODING.DEFAULT}"?>
, isn't it?

Show
Herve Boutemy added a comment - can you attach pom.xml for some.group.id:myproject-war? I suppose it starts with
<?xml version="1.0" encoding="${ENCODING.DEFAULT}"?>
, isn't it?
Hide
David J. M. Karlsen added a comment -

Please see attached file for example.

Show
David J. M. Karlsen added a comment - Please see attached file for example.
Hide
David J. M. Karlsen added a comment -

Se attachment number two (pom.xml) which is a cleanup of the one originally posted (examplepom.xml).

Parent pom has a correct and valid xml-header, I only refer to the encoding.default variable in configuration elements for plugins.

With 2.0.8
mvn clean should be sufficient to trigger:

zoidberg:/tmp# mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: unknown

Reason: Failed to build model from file '/tmp/pom.xml'.
Error: '${ENCODING.DEFAULT}' for project unknown


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to build model from file '/tmp/pom.xml'.
Error: '${ENCODING.DEFAULT}' for project unknown
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:376)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:289)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Failed to build model from file '/tmp/pom.xml'.
Error: '${ENCODING.DEFAULT}' for project unknown
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1386)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:474)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:548)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:458)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:362)
... 11 more
Caused by: java.io.UnsupportedEncodingException: ${ENCODING.DEFAULT}
at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:52)
at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
at hidden.org.codehaus.plexus.util.xml.XmlReader.prepareReader(XmlReader.java:479)
at hidden.org.codehaus.plexus.util.xml.XmlReader.doRawStream(XmlReader.java:462)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:179)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:142)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:123)
at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:67)
at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:113)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1376)
... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Jan 09 01:52:31 CET 2008
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------

Show
David J. M. Karlsen added a comment - Se attachment number two (pom.xml) which is a cleanup of the one originally posted (examplepom.xml). Parent pom has a correct and valid xml-header, I only refer to the encoding.default variable in configuration elements for plugins. With 2.0.8 mvn clean should be sufficient to trigger: zoidberg:/tmp# mvn clean [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: unknown Reason: Failed to build model from file '/tmp/pom.xml'. Error: '${ENCODING.DEFAULT}' for project unknown [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.reactor.MavenExecutionException: Failed to build model from file '/tmp/pom.xml'. Error: '${ENCODING.DEFAULT}' for project unknown at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:376) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:289) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126) at org.apache.maven.cli.MavenCli.main(MavenCli.java:282) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.project.ProjectBuildingException: Failed to build model from file '/tmp/pom.xml'. Error: '${ENCODING.DEFAULT}' for project unknown at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1386) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:474) at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197) at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:548) at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:458) at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:362) ... 11 more Caused by: java.io.UnsupportedEncodingException: ${ENCODING.DEFAULT} at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:52) at java.io.InputStreamReader.<init>(InputStreamReader.java:83) at hidden.org.codehaus.plexus.util.xml.XmlReader.prepareReader(XmlReader.java:479) at hidden.org.codehaus.plexus.util.xml.XmlReader.doRawStream(XmlReader.java:462) at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:179) at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:142) at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:123) at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:67) at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:113) at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1376) ... 16 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Wed Jan 09 01:52:31 CET 2008 [INFO] Final Memory: 1M/4M [INFO] ------------------------------------------------------------------------
Hide
Herve Boutemy added a comment -

ok, I was able to reproduce the problem.
I opened PLXUTILS-60, since the problem is in XmlStreamReader class in plexus-utils (and in fact in XmlReader class from Rome, which is the library I got the class from )

Show
Herve Boutemy added a comment - ok, I was able to reproduce the problem. I opened PLXUTILS-60, since the problem is in XmlStreamReader class in plexus-utils (and in fact in XmlReader class from Rome, which is the library I got the class from )
Hide
Herve Boutemy added a comment -

fixed in r630415 in trunk and r630416 in 2.0.x branch

Show
Herve Boutemy added a comment - fixed in r630415 in trunk and r630416 in 2.0.x branch

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: