Skip to content

Commit

Permalink
Fix #78
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jul 11, 2019
1 parent 9d4ca4e commit d9bde1d
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
57 changes: 52 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,26 @@
For now, we'll just use "msv", which does not properly define
dependencies...
Also: make these 'provided', since user needs to include them
directly. Not sure what OSGi thinks about that but...
Also: keep `optional` (`provided` will not work for some reason
with shade plugin?) to prevent dependency
-->
<dependency>
<groupId>net.java.dev.msv</groupId>
<artifactId>msv-core</artifactId>
<version>${version.msv}</version>
<!--
<scope>provided</scope>
-->
<optional>true</optional>
</dependency>

<dependency>
<groupId>net.java.dev.msv</groupId>
<artifactId>xsdlib</artifactId>
<version>${version.msv}</version>
<!--
<scope>provided</scope>
-->
<optional>true</optional>
</dependency>

Expand All @@ -134,11 +138,10 @@
<artifactId>org.osgi.core</artifactId>
<version>1.4.0</version>
<optional>true</optional>
<scope>provided</scope>
<scope>provided</scope>
</dependency>

<!-- Then test jars
-->
<!-- Then test deps -->

<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -188,6 +191,50 @@
</configuration>
</plugin>

<plugin>
<!-- We will shade MSV, partly to simplify deployment, but also to work
around Java 9+ module-info issues (MSV not retrofitted)
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
<!-- the bundle plugin already did the pulling-in, all we need is the renaming! -->
<include>net.java.dev.msv:msv-core</include>
<include>net.java.dev.msv:xsdlib</include>
</includes>
</artifactSet>
<relocations>
<!-- First, xsdlib (must order first) -->
<relocation>
<pattern>com.sun.msv.xsd</pattern>
<shadedPattern>com.ctc.wstx.shaded.msv-xsd</shadedPattern>
</relocation>
<relocation> <!-- and one stupid little class xsdlib has for reasons -->
<pattern>com.sun.xml.util</pattern>
<shadedPattern>com.ctc.wstx.shaded.msv-xsd-util</shadedPattern>
</relocation>

<!-- then msv-core -->
<relocation>
<pattern>com.sun.msv</pattern>
<shadedPattern>com.ctc.wstx.shaded.msv-core</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>


<!-- 03-Jun-2019, tatu: Trying to rudimentary JDK9+ module info. To build with JDK 8
will have to use `moduleInfoFile` which is crappy but anything else requires
JDK 9+.
Expand Down
4 changes: 4 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Project: woodstox
=== Releases ===
------------------------------------------------------------------------

5.3.0 (not yet released)

#78: Shade MSV dependency

5.2.1 (14-May-2019)

#74: Infinite loop in BijectiveNsMap#addGeneratedMapping when ctxt.getNamespaceURI(prefix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void testLongerCData3() throws Exception {
// System.err.println("DEBUG: initial length = "+text.length());
while (sr.next() == CDATA) {
text += sr.getText();
System.err.println("DEBUG: another CDATA, len now: "+text.length());
// System.err.println("DEBUG: another CDATA, len now: "+text.length());
}
// fail("Length expected as " + DST_TEXT.length() + ", was " + text.length());
}
Expand Down

0 comments on commit d9bde1d

Please sign in to comment.