Skip to content

parser does not seem to parse some parts of the XML correctly. #5

@vaikas

Description

@vaikas

I'm using github.com/2000Slash/gopom to parse the original pom.xml file. It seems to not parse some sections of the XML correctly though, even when just round-tripping an XML file with no patches, there are differences, so I need to dig into it. Maybe some of these are marshaling issues, but some for sure are losing information on the parsing. Here's some things I'm seeing diffs in:

Original:

<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/xsd/maven-4.0.0.xsd">

Marshalled:

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

This is for sure being dropped on the parsing (as debugged by looking at the actual structs returned):

<profiles>
        <profile>
            <id>errorprone-compiler</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <!--suppress MavenModelInspection -->
                        <configuration combine.children="merge">
                            <!-- forking not required due to JVM flags in .mvn/jvm.config -->
                            <!-- see https://errorprone.info/docs/installation#maven -->
                            <!-- Do not fail on error-prone's warnings even for modules using air.compiler.fail-warnings -->
                            <!-- TODO silence warnings we choose to ignore and raise important warnings to error and then remove <failOnWarning> -->
                            <failOnWarning>false</failOnWarning>
                            <compilerArgs>
                                <arg>-XDcompilePolicy=simple</arg>
                                <arg>
                                    -Xplugin:ErrorProne \
                                    -Xep:AnnotateFormatMethod:ERROR \
                                    -Xep:BadComparable:ERROR \
                                    -Xep:BadInstanceof:ERROR \
                                    -Xep:BoxedPrimitiveConstructor:ERROR \
                                    -Xep:ClassCanBeStatic:ERROR \
    <!-- SNIP SNIP SNIP SNIP -->
                                    -XepExcludedPaths:.*/target/generated-(|test-)sources/.*
                                </arg>
                            </compilerArgs>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>com.google.errorprone</groupId>
                                    <artifactId>error_prone_core</artifactId>
                                    <version>${dep.errorprone.version}</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

vs.

<profiles>
    <profile>
      <id>errorprone-compiler</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <annotationProcessorPaths>

                            </annotationProcessorPaths>
              <failOnWarning>false</failOnWarning>
              <compilerArgs>


                            </compilerArgs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions