Split package scanner

Tool to scan existing JAR/WAR files for split packages

License

License

Categories

Categories

Java Languages Jakarta Server Pages Jakarta EE The Web Tier
GroupId

GroupId

org.adoptopenjdk
ArtifactId

ArtifactId

jsplitpkgscan
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Split package scanner
Tool to scan existing JAR/WAR files for split packages
Project URL

Project URL

https://github.com/AdoptOpenJDK/jsplitpkgscan
Source Code Management

Source Code Management

https://github.com/AdoptOpenJDK/jsplitpkgscan

Download jsplitpkgscan

How to add to project

<!-- https://jarcasting.com/artifacts/org.adoptopenjdk/jsplitpkgscan/ -->
<dependency>
    <groupId>org.adoptopenjdk</groupId>
    <artifactId>jsplitpkgscan</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.adoptopenjdk/jsplitpkgscan/
implementation 'org.adoptopenjdk:jsplitpkgscan:1.0.0'
// https://jarcasting.com/artifacts/org.adoptopenjdk/jsplitpkgscan/
implementation ("org.adoptopenjdk:jsplitpkgscan:1.0.0")
'org.adoptopenjdk:jsplitpkgscan:jar:1.0.0'
<dependency org="org.adoptopenjdk" name="jsplitpkgscan" rev="1.0.0">
  <artifact name="jsplitpkgscan" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.adoptopenjdk', module='jsplitpkgscan', version='1.0.0')
)
libraryDependencies += "org.adoptopenjdk" % "jsplitpkgscan" % "1.0.0"
[org.adoptopenjdk/jsplitpkgscan "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

OpenJDK split package scanner

GNU General Public License, version 2, with the Classpath Exception Supported Versions Build Status Maven Central

This project contains a proposal for OpenJDK split package scanner addition.

The diving force starting this tool was the lack of tooling to prepare existing class path based modules for later migration to modules. For split packages with the current JDK, they will be shown by the jdeps tool as of today, but not class path based modules so far.

The jsplitpgkscan utility will search for split packages within all given .jar files and the modules known to the JDK itself and report them.

Build and run

To build the tool you need to have a actual JDK build that you can get from https://jdk.java.net/12, https://adoptopenjdk.net or other providers. Make sure that you have at least version jdk-12 installed.

To build use:

./gradlew clean build

After the build was sucessful you can now start it using:

java -p build/libs -m jsplitpkgscan

The usage is as follows

Usage: jsplitpkgscan <options> <path ...>]
<path> can be a pathname to a JAR/WAR/RAR file or exploded JAR/WAR/RAR file.
Possible options include:
  -h -? --help                  Print this usage message
  -a                            Report all packages for each found JAR/RAR/WAR
                                file or exploded directory
  -d <directory>                Directory containing JAR/RAR/WAR files or
                                exploded directories to scan
                                (scans subdirectories as well)
  -f <file>                     File containing a list of JAR/RAR/WAR files
                                or exploded directories to scan
  -p <package prefix>           Package prefix to report only split packages
                                that matches this prefix
  --dot-output <dir>            Destination directory for DOT file output

In order to create your own distribution using jlink you can enter the following command if you have JAVA_HOME set:

$JAVA_HOME/bin/jlink --module-path $JAVA_HOME/jmods:build/libs --add-modules jsplitpkgscan \
  --launcher jsplitpkgscan=jsplitpkgscan --output /tmp/jsplitpkgscan

For using the tool from inside you’re code, you can access it looking it up a an java.util.spi.ToolProvider implementation as follows:

int rc = ToolProvider.findFirst("jsplitpgkscan")
                     .ifPresent(tool -> tool.run(System.out, System.err, "-h")

Create DOT graphic

To get a .png graphic for any .dot file output for directed graphs you could use:

dot -Tpng summary.dot -O -Gratio=0.5

If your experience problems due undirected graphs you could also use this command:

twopi -Tpng summary.dot -O -Gratio=0.5 -Goverlap=false

Contribute

Contributions are always welcome.

License

org.adoptopenjdk

AdoptOpenJDK

The Community and code behind the Build Farm which produces high quality, FREE OpenJDK (Java) binaries.

Versions

Version
1.0.0