Query on usage of exclude-resources plugin

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 25 08:17:33 UTC 2017

On 25/04/2017 08:37, Sabari L Krishnamoorthy wrote:

> Hi,
> I was experimenting to use --exclude-resources plugin to remove .class
> files from modules.
> While trying to exclude a single .class file using this plugin works (see
> point 1 below), but removal of all .class files from a package throws
> error (see point 2 below)
`--exclude-resources` is an option that must be used with great care. 
It's intended for stripping resources that you are sure are not needed. 
In the usage message then you'll see "jcov" is mentioned and removing 
data files generated for coverage analysis tools is a good example of 
something that can be stripped. Another example is resource files in 
META-INF/** that you know are not needed by libraries when deployed as 

The option can be used to remove .class resources but too easy to burn 
your hands. In the examples then you've removed an entire package and so 
are falling foul of consistency checks. There are also potential 
compliance issues if you remove API classes or classes that make APIs 
inoperable. You might want to look at examples such as the 
include-locales plugin where jdk.localedata module is safely transformed 
a link time to include only the required locales.


More information about the jigsaw-dev mailing list