Skip to content

Commit

Permalink
JDK 11 modular jar compatible with jmod/jlink compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
DrPlantabyte committed Dec 27, 2019
1 parent b4f0230 commit e3e21dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nanojson is dual-licensed under the MIT and Apache Public License.

* Build: `mvn clean compile test jar:jar`
* Javadocs: `mvn javadoc:javadoc && open target/site/apidocs/index.html`

Add it to your maven pom.xml:

<dependency>
Expand All @@ -26,6 +26,19 @@ Add it to your maven pom.xml:

... or just drop the files directly into your project!


**And then**, in your *module-info.java* file, add *requires com.grack.nanojson;* to your list of required modules. For example:
```
module mypackage.mymodule {
exports mypackage.mymodule;
requires com.grack.nanojson;
requires java.desktop;
requires java.logging;
}
```

## Features

### Fast
Expand Down
19 changes: 5 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<artifactId>nanojson</artifactId>
<packaging>jar</packaging>
<name>nanojson</name>
<version>1.5-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -143,6 +143,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<excludes>**/module-info.java</excludes>
<configLocation>checkstyle.xml</configLocation>
<propertyExpansion>basedir=${basedir}</propertyExpansion>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
Expand Down Expand Up @@ -193,8 +194,9 @@
<configuration>
<debug>true</debug>
<debuglevel>none</debuglevel>
<source>1.7</source>
<target>1.7</target>
<source>11</source>
<target>11</target>
<release>11</release>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
Expand All @@ -211,17 +213,6 @@
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.grack.nanojson</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit e3e21dc

Please sign in to comment.