These are chat archives for sbt/sbt

18th
Apr 2017
G. Richard Bellamy
@rbellamy
Apr 18 00:08
I want to add a dependency to my test and testOnly tasks...
(testOnly in Test) := (testOnly in Test).dependsOn((flywayMigrate in Test).dependsOn(flywayClean in Test)).inputTaskValue,
####
[error] No valid parser available.
[error] testOnly **.UserDaoSpec
No valid parser available seems like one of those truly opaque SBT errors that tells me exactly what my problem is, and doesn't help me at all to know what that problem is
I've done a bit of digging on how to add dependencies to my test execution
I started with:
executeTasks in Test := ...
but that didn't cause the testOnly task to have those dependencies
OlegYch
@OlegYch
Apr 18 00:22
i'd suggest to just call flyway directly from your tests
G. Richard Bellamy
@rbellamy
Apr 18 00:23
@OlegYch I figured it out
I needed to be using the .evaluated result of the testOnly InputTaskKey
@OlegYch and I'm coming to believe you are correct...
but it goes against what I've had success with in the past when doing testing that includes database setup/teardown
which is that you should automate that setup and teardown
specifically because having that codified eases CI
OlegYch
@OlegYch
Apr 18 00:27
you're still automating it
in a more direct way
G. Richard Bellamy
@rbellamy
Apr 18 00:28
I think maybe I'm missing something here... are you suggesting that I remove the flyway SBT integration and then (somehow) run flyway from the tests directly?
OlegYch
@OlegYch
Apr 18 00:28
yes
G. Richard Bellamy
@rbellamy
Apr 18 00:29
okay... I'm definitely open to the suggestion. Do you have any pointers or examples that I could use as guidance?
making this work from SBT is seeming more and more of a case of a nail looking for a hammer
OlegYch
@OlegYch
Apr 18 00:29
org.flywaydb.core.Flyway#migrate
G. Richard Bellamy
@rbellamy
Apr 18 00:31
hmmmmmmmm
so you're suggesting I call the Flyway API directly from within my tests
OlegYch
@OlegYch
Apr 18 00:33
yeah, and from main app too
G. Richard Bellamy
@rbellamy
Apr 18 00:36
I'm looking into that right now...
Jorge
@jvican
Apr 18 11:22
Hello everyone, just in case someone in this room has missed this, the Scala Center is planning to contribute to sbt: https://contributors.scala-lang.org/t/asking-for-your-feedback-on-sbt-scala-center-announcement/738/14.
We would like to gather all your feedback to understand what are the most urgent issues you'd like to see fixed.
Yuval Itzchakov
@YuvalItzchakov
Apr 18 14:59

Hi, I'm attempting to add the typesafe repository SSL certificate to the java truststore, but for some reason having trouble with SBT identifying them properly. My assumption was if I download the certificate using openssl, and import the certificate chain it should be fine, but I'm still getting a verification error.

Anything I might be missing?

Im seeing, as an example:

[error] Server access Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target url=https://repo.typesafe.com/typesafe/ivy-releases/com.github.gseitz/sbt-release/scala_2.10/sbt_0.13/1.0.0/ivys/ivy.xml

Although when I look for the lightbend certificate, I see it there:

Owner: CN=repo.lightbend.com, OU=PositiveSSL Multi-Domain, OU=Domain Control Validated
Issuer: CN=COMODO RSA Domain Validation Secure Server CA, O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB
Serial number: 971da6e69f9f3fda0575059dd333b38f
Valid from: Fri Apr 08 03:00:00 IDT 2016 until: Tue Nov 13 01:59:59 IST 2018
Certificate fingerprints:
         MD5:  74:40:4E:5E:87:F6:B4:13:E5:42:99:79:66:A8:64:28
         SHA1: F5:33:21:AF:17:0A:79:5D:1A:35:34:7A:FF:30:E2:8F:A1:4B:54:9B
         SHA256: 47:3A:33:02:99:F9:D0:24:F1:B3:BA:3A:82:28:C0:62:B5:26:DF:7C:DB:81:6C:DA:AA:6E:29:8E:8B:18:8B:EB
         Signature algorithm name: SHA256withRSA
         Version: 3
Eric K Richardson
@ekrich
Apr 18 16:06
I had luck at one time downloading certificates via Firefox and then importing that into java. I can't remember all the details but it worked.
Yuval Itzchakov
@YuvalItzchakov
Apr 18 17:03
No matter what I do, doesn't seem to work
I imported the entire certificate chain
ritschwumm
@ritschwumm
Apr 18 17:06
@YuvalItzchakov does java know it's a chain? i can't remember exactly, but i had a lot of problems with that a while ago.
Yuval Itzchakov
@YuvalItzchakov
Apr 18 17:21
Ok, I made it work. I copied all root certificates from cacerts to jssecacerts
And then it was happy
ritschwumm
@ritschwumm
Apr 18 17:25
:)
Yuval Itzchakov
@YuvalItzchakov
Apr 18 17:26
:+1:
Eric K Richardson
@ekrich
Apr 18 18:00
Nice :-)
Adelbert Chang
@adelbertc
Apr 18 22:16
:clap:
what distinguished SBT_OPTS from JVM_OPTS in sbt-extras?
e.g. is sbt.override.build.repos an SBT opt? it seems to work as a JVM_OPT as well
also for sbt.ivy.home and ivy.home
Adelbert Chang
@adelbertc
Apr 18 22:22
i suppose maybe SBT_OPTS is anything that starts with "sbt"
Brian Topping
@briantopping
Apr 18 23:05
@adelbertc Maybe it's a carryover to from a day when SBT_OPTS were in people's shell vars? Then they wouldn't interfere with opts that a user desired for every java program. Just a guess.
eugene yokota
@eed3si9n
Apr 18 23:06
for the official launcher both gets used the same way I think
it could be that JVM_OPTS are used for other JVM tools
whereas SBT_OPTS are specific to sbt
Brian Topping
@briantopping
Apr 18 23:07
yes, that's what I was wondering
eugene yokota
@eed3si9n
Apr 18 23:07
not that I run any other JVM tools
I can see how it could be useful for proxy setting etc
Brian Topping
@briantopping
Apr 18 23:08
Question: Resolver.url("global-ivy", url("<local-repo-group>"))(Resolver.ivyStylePatterns) (note the ivyStylePatterns usage) still calls that repository with a maven style path. Am I missing something obvious? Tested with 0.13.13 and 0.13.15...
there's no ~/.sbt/resolvers file, launcher script changes or command line args when I am seeing this
eugene yokota
@eed3si9n
Apr 18 23:09
I'm assuming you're using Ivy
as opposed to coursier
Brian Topping
@briantopping
Apr 18 23:10
ah, yes
should I try coursier? is it reasonably stable?
(reasonable ~= >65% stable)
eugene yokota
@eed3si9n
Apr 18 23:11
i want to first understand the Resolver.url issue tho
ritschwumm
@ritschwumm
Apr 18 23:11
i use it in all my projects.
Brian Topping
@briantopping
Apr 18 23:12
sure, thanks. what can I provide?
the group repository is nexus, containing a proxy repo to bintray
I read somewhere that it will fetch properly, just not do the indexes properly
whether it does or not is kind of inconsequential because the stdout for the build shows the fetch URLs in maven format
eugene yokota
@eed3si9n
Apr 18 23:13
debug log of your update task I guess
Brian Topping
@briantopping
Apr 18 23:13
kk sec
ritschwumm
@ritschwumm
Apr 18 23:13
@briantopping works in all projects (about 100), except one where it reordered two conflicting dependencies leading to a runtime failure
Brian Topping
@briantopping
Apr 18 23:14
@ritschwumm thanks!
So first the resolver:
resolvers ++= Seq(
Resolver.url("global-ivy", url("<local-repo-group>"))(Resolver.ivyStylePatterns),
  DefaultMavenRepository
)
eugene yokota
@eed3si9n
Apr 18 23:15
I'm going to be afk for a bit (I'll be back in 10min~)
Brian Topping
@briantopping
Apr 18 23:16
log:
[warn]     module not found: uk.gov.hmrc#sbt-git-stamp;5.3.0
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/uk.gov.hmrc/sbt-git-stamp/5.3.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/uk.gov.hmrc/sbt-git-stamp/5.3.0/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /Users/brian/.ivy2/local/uk.gov.hmrc/sbt-git-stamp/5.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/uk/gov/hmrc/sbt-git-stamp/5.3.0/sbt-git-stamp-5.3.0.pom
[warn] ==== global-ivy: tried
[warn]   https://<nexus3 server>/uk.gov.hmrc/sbt-git-stamp/5.3.0/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/uk/gov/hmrc/sbt-git-stamp/5.3.0/sbt-git-stamp-5.3.0.pom
eugene yokota
@eed3si9n
Apr 18 23:50
so it says https://<nexus3 server>/uk.gov.hmrc/sbt-git-stamp/5.3.0/ivys/ivy.xml
that's Ivy style