Skip to content

Commit

Permalink
Repackaged the library with native (vs automatic) JPMS module support
Browse files Browse the repository at this point in the history
Fixes #1943
Fixes #1466
  • Loading branch information
jhy committed Nov 1, 2023
1 parent 98200db commit 882bb9c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Release 1.17.1 [PENDING]
* Improvement: added the `:is(selector list)` pseudo-selector, which finds elements that match any of the selectors in
the selector list. Useful for making large ORed selectors more readable.

* Improvement: repackaged the library with native (vs automatic) JPMS module support.

* Bugfix: when outputting with XML syntax, HTML elements that were parsed as data nodes (<script> and <style>) should
be emitted as CDATA nodes, so that they can be parsed correctly by an XML parser.
<https://github.com/jhy/jsoup/pull/1720>
Expand Down
32 changes: 28 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@

<build>
<plugins>
<!-- Compile -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<!-- saves output for package-info.java, so mvn sees it has completed it, so incremental compile works -->
Expand All @@ -53,9 +52,34 @@
<!-- this means incremental = true... -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
<executions>
<execution>
<id>compile-java-8</id>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</execution>
<execution>
<id>compile-java-9</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>

</plugin>

<!-- Ensure Java 8 and Android 10 API compatibility -->
<plugin>
<!-- Ensure Java 8 and Android 10 API compatibility -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.23</version>
Expand Down Expand Up @@ -136,7 +160,7 @@
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Automatic-Module-Name>org.jsoup</Automatic-Module-Name>
<Multi-Release>true</Multi-Release>
</manifestEntries>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module org.jsoup {
exports org.jsoup;
exports org.jsoup.helper;
exports org.jsoup.nodes;
exports org.jsoup.parser;
exports org.jsoup.safety;
exports org.jsoup.select;

requires transitive java.xml; // for org.w3c.dom out of W3CDom
}

0 comments on commit 882bb9c

Please sign in to comment.