tools.deps

Updates to pom continually adds superfluous newlines under Java 9

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    version: 1.9.0.297

    java version "9.0.1"
    Java(TM) SE Runtime Environment (build 9.0.1+11)
    Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

Description

Under Java 9, each invocation of `clj -Spom` to update an existing pom causes newlines to be added.

/private/tmp/pom-bug> head pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>pom-bug</groupId>
  <artifactId>pom-bug</artifactId>
  <version>0.1.0</version>
  <name>pom-bug</name>
  <dependencies>
    <dependency>
      <groupId>org.clojure</groupId>
/private/tmp/pom-bug> clj -Spom 2>/dev/null
/private/tmp/pom-bug> head pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">

  <modelVersion>4.0.0</modelVersion>

  <groupId>pom-bug</groupId>

  <artifactId>pom-bug</artifactId>

  <version>0.1.0</version>
/private/tmp/pom-bug> clj -Spom 2>/dev/null
/private/tmp/pom-bug> head pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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">


  <modelVersion>4.0.0</modelVersion>


  <groupId>pom-bug</groupId>

It's worth noting that this happens only under Java 9. Java 1.8.0_152 works as expected.

Activity

Hide
Alex Miller added a comment -

-Spom uses data.xml, which uses javax.xml.transform.Transformer, which has had changes in Java 9, presumably due to the update to Xerces-J 2.11.0 (https://xerces.apache.org/xerces2-j/releases.html). Here's a blog outlining some of the effects: http://java9.wtf/xml-transformer/. Possibly also relevant: https://bugs.java.com/view_bug.do?bug_id=JDK-8087303

Show
Alex Miller added a comment - -Spom uses data.xml, which uses javax.xml.transform.Transformer, which has had changes in Java 9, presumably due to the update to Xerces-J 2.11.0 (https://xerces.apache.org/xerces2-j/releases.html). Here's a blog outlining some of the effects: http://java9.wtf/xml-transformer/. Possibly also relevant: https://bugs.java.com/view_bug.do?bug_id=JDK-8087303
Hide
Alex Miller added a comment -

Filed an issue at DXML-53 for this as that's really where it would ideally be fixed.

Show
Alex Miller added a comment - Filed an issue at DXML-53 for this as that's really where it would ideally be fixed.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated: