Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory entries are not included in the generated jar file #52

Open
TheImplementer opened this issue Jan 4, 2020 · 0 comments
Open

Comments

@TheImplementer
Copy link
Contributor

It looks like jar files generated using the groovy_library rule, unlike the ones generated with the java_library one, don't contain directory entries.

For instance, given a java class Test.class under the com.example package, the resulting jar file would contain the following entries (excluding the META-INF directory):

  • com/
  • com/example/
  • com/example/Test.class

At runtime, the following code will then work as expected, returning a URL to the jar file:

ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
URL url = systemClassLoader.getResource("com/example");

The same does not work (the URL returned is null) with a jar generated with the groovy_library rule because the only entry in it is: com/example/Test.class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant