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
…#2025)

Repackaged the library with native (vs automatic) JPMS module support

Fixes #1943
Fixes #1466

Min builder is JDK 9

#2026 tracks adding a test action (not compile) for JDK 8.
  • Loading branch information
jhy authored Nov 1, 2023
1 parent 98200db commit a8564c3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
# choosing to run a reduced set of LTS, current, and next, to balance coverage and execution time
java: [8, 17, 21]
java: [11, 17, 21]
fail-fast: false
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ 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.
<https://github.com/jhy/jsoup/pull/2025>

* 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 a8564c3

Please sign in to comment.