[ 
http://jira.codehaus.org/browse/MRELEASE-255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_105611
 ] 

Carsten Ziegeler commented on MRELEASE-255:
-------------------------------------------

I can confirm that this is still a bug - under specific circumstances the 
plugin removes everything before the first xml element (the intro and outro 
parts).

After some testing, I found some problems: the main problem is that the pom is 
parsed into a dom and then compared with a string version to detect the intro 
and outro parts. If the underlying dom implementation or the serialization from 
the dom to a string is altering only one single character the comparison will 
fail, and intro and outro is removed!

One problem I noticed are the namespace and schema definitions:

If I have the following in my pom:
<project xmlns="http://maven.apache.org/POM/4.0.0";
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>

everything before <project> is removed, if I use

<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>

(everything in one line and specific order) it works!

Imho, the current approach should be replaced with an approach which just 
replaces the changing elements in the pom, like a sax based approach which 
detects the locations and just changes them on the fly. A very simple approach 
would be to use an xslt stylesheet for this: it can match on the elements to 
change and just copy everything else. If you need help in such a solution, let 
me know.


> during a release several elements are removed from the pom.xml (which should 
> be left there)
> -------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-255
>                 URL: http://jira.codehaus.org/browse/MRELEASE-255
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0-beta-4
>            Reporter: Roman Cerny
>
> the following elements are removed from the pom.xml, during a release...
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- SVN keywords
>  $Author: $
>  $Revision: $
>  $Date: $
> -->
> <!DOCTYPE project [
>   <!ENTITY auml    "&#228;" >
>   <!ENTITY ouml    "&#246;" >
>   <!ENTITY uuml    "&#252;" >
>   <!ENTITY szlig   "&#223;" >
> ]>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to