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

Compiled script fails to find resource #496

Closed
blintend opened this Issue Nov 2, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@blintend

blintend commented Nov 2, 2016

See the sample script, the first and the second run below.
Environment: Ammonite 0.7.8, Scala 2.11.8, Java 1.8.0_111, Ubuntu 16.04.1
Expected: both invocations succeed.
Actual: the compiled script does not find the resource in the ivy-imported jar.

  • cat amm-issue.sc
#! /usr/bin/env amm
import $ivy.`io.kamon::kamon-core:0.6.3`
import ammonite.ops._
read(resource/"reference.conf")
  • ./amm-issue.sc
Compiling amm-issue.sc
  • ./amm-issue.sc
Exception in thread "main" ammonite.ops.ResourceNotFoundException: sun.misc.Launcher$AppClassLoader@3d4eac69/reference.conf
	at ammonite.ops.ResourcePath.getInputStream(Path.scala:327)
	at ammonite.ops.Readable$class.getBytes(PathUtils.scala:19)
	at ammonite.ops.ResourcePath.getBytes(Path.scala:320)
	at ammonite.ops.read$.apply(FileOps.scala:333)
	at ammonite.ops.read$.apply(FileOps.scala:332)
	at $file.amm$minusissue$.<init>(amm-issue.sc:4)
	at $file.amm$minusissue$.<clinit>(amm-issue.sc)
	at $file.amm$minusissue.$main(amm-issue.sc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment