alexarchambault on 1.6.3
alexarchambault on master
1.6.3 (compare)
lihaoyi on gh-pages
5ad9ae5538f23cab92ccd8c6b1617d8… (compare)
alexarchambault on master
Partly revert 84d48542 (#923) … (compare)
i would like to use repl.sess.save and repl.sess.load in my scala code, - they are visible from the predef, but i would like to use them inside a class that belongs to a different package.
from what i understand, they become available after the shell is started with Main(), but id like the following piece of code to compile as well"
// def getArtificats(
// service: String,
// serviceVersion: String,
// serviceDependencyVersion: String,
// namespace: String
// ) {
//
//
// val sessionTag = s"$service:$serviceVersion:$serviceDependencyVersion"
// repl.sess.save(sessionTag)
//
// val dep = coursier.
// Dependency(
// coursier.Module(namespace, service),
// serviceVersion,
// attributes = coursier.Attributes(classifier = "fat")
// )
//
// printf(s"finished fetching dependencies for $service-$serviceVersion with dependencies from version $serviceDependencyVersion")
// repl.sess.load(sessionTag)
// printf(s"session $sessionTag restored ")
// }
instantiateInterpreter
and processModule
heads in the right direction, but the details seem hazy, especially around accessing bindings in the .sc
.
build sbt
, I can run ammonite with sbt test:run
. However, when I do sbt test
, which previously would run my unit tests, I get java.util.NoSuchElementException: None.get
. Did anyone encounter this?
Hoping someone can give me a pointer - I'm sat behind a corporate proxy trying to use ammonite. We have nexus setup between us and maven. I have successfully downloaded some ivy's into ammonite - import $ivy.com.lihaoyi::scalatags:0.7.0
works, which I think proves proves my predefs and coursier resolvers appear to be setup correctly.
I'd like to use com.github.seratch::awscala-s3:0.8.2
, but that fails with an error that looks like; download error: Caught javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
. The same import (correctly formatted!) works (inside an sbt project), so I think the problem is that somehow ammonite is missing my corporate certificate.
Does this sound right? Is there a place I could attempt to add the cert so that ammonite knows about it? Any other hints or ideas?
Are you able to reproduce that error with the coursier CLI?
Calling it like
$ coursier resolve \
--no-default \
-r https://your-corporate-repo \
com.github.seratch::awscala-s3:0.8.2
should result in an error IIUC your issue.
JAVA_OPTS='-Xmx1G -Djavax.net.ssl.keyStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts -Djavax.net.ssl.trustStorePassword=changeit'
update-ca-certificates
as root.