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

scriptFile needs to be in the shaded jar but README suggests otherwise #12

Closed
tomdz opened this issue Apr 3, 2015 · 7 comments · Fixed by #13
Closed

scriptFile needs to be in the shaded jar but README suggests otherwise #12

tomdz opened this issue Apr 3, 2015 · 7 comments · Fixed by #13

Comments

@tomdz
Copy link
Collaborator

tomdz commented Apr 3, 2015

The README suggests that the scriptFile can be some file somewhere in the project (src/packaging/someScript.extension) but actually it currently has to be in the shaded jar (https://github.com/brianm/really-executable-jars-maven-plugin/blob/master/src/main/java/org/skife/waffles/ReallyExecutableJarMojo.java#L169-170).
Either the README should be updated or the plugin should use file resolution instead of the classloader.

@brianm
Copy link
Owner

brianm commented Apr 11, 2015

Ah, looks like someone changed the behavior at some point.

My tendency would be to make it part of the project -- do you have a preference?

@tomdz
Copy link
Collaborator Author

tomdz commented Apr 15, 2015

I'd prefer it to be a plain path. You can always point it to src/main/resources/... and usually there is no reason to include the script as a file in the jar.

@Sylvain-Bugat
Copy link

With the latest release version (1.4.0), I encounter this issue too. I understand too that the readme said that the configured script file is a direct path.
If the file cannot be found in the constructed jar, a NullPointerException occurs here because of the null InputStream scriptIn variable.

Stack trace:

Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:248)
        at org.codehaus.plexus.util.IOUtil.toString(IOUtil.java:307)
        at org.codehaus.plexus.util.IOUtil.toString(IOUtil.java:295)
        at org.skife.waffles.ReallyExecutableJarMojo.makeExecutable(ReallyExecutableJarMojo.java:172)
        at org.skife.waffles.ReallyExecutableJarMojo.execute(ReallyExecutableJarMojo.java:129)

If the script must be read in the constructed jar, a log and null check may be added.

@brianm
Copy link
Owner

brianm commented Apr 19, 2015

Makes sense to me that way to, let me fix right now!

@brianm
Copy link
Owner

brianm commented Apr 19, 2015

Can you check this for me? If it looks good, will merge and release.

@brianm
Copy link
Owner

brianm commented Apr 20, 2015

Released 1.4.1, is up on oss.s.o and should sync to central before long.

@Sylvain-Bugat
Copy link

Nice! Tested with version 1.4.1 release plugin from the central repository and it works fine (build ok and jar tests ok).

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

Successfully merging a pull request may close this issue.

3 participants