Is there any way to verify at compile time that a resource referenced in source code has been included in an output JAR?
I am creating a Java JAR file that contains several PNGs. I load them like this:
ImageIcon imageIcon = new ImageIcon(MyClass.class.getResource("/path/to/resource.png");
Currently I don't find out about missing resources until I get exceptions at run time. I don't want a static list of resources in my build script, I want the compiler to figure out which resources I'm using in the code and check that they exist.