SBT 0.10.0/0.10.11 -- Potentially incompatible versions specified - sbt

I'm getting an error when running SBT, which I don't know where it originates from:
[info] Set current project to root (in build file:/home/dcs/.sbt/plugins/)
[warn] Potentially incompatible versions specified:
[warn] org.scala-tools.sbt: 0.10.1, 0.10.0
The JAR file for the sbt laucher is version's 0.10.1. The error happens even outside projects, such as when running screpl.
How do I fix it?

Do you have a build.sbt in /home/dcs/.sbt/build.properties that sets a particular sbt.version?
If not, you may have a global plugin installed that requires 0.10.0 as mentioned at https://groups.google.com/forum/#!topic/simple-build-tool/YoXd0Tp_cjo/discussion. The solution there was to wipe the global .sbt directory (your /home/dcs/.sbt).

Related

sbt supress ignoring option MaxPermSize=256m

PS D:\Users\erick\repos\leaderboard> sbt about
The Java Development Kit (JDK) installation you have is not up to date.
sbt requires at least version 6+, you have
version 0
Please go to http://www.oracle.com/technetwork/java/javase/downloads/ and download
a valid JDK and install before running sbt.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from D:\Users\erick\repos\leaderboard\project
[info] Loading settings from build.sbt ...
[info] Set current project to leaderboard (in build file:/D:/Users/erick/repos/leaderboard/)
[info] This is sbt 1.1.4
[info] The current project is ProjectRef(uri("file:/D:/Users/erick/repos/leaderboard/"), "leaderboard") 0.0.0
[info] The current project is built against Scala 2.12.5
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4
Been searching for almost an hour for some way to suppress
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
in SBT, but it seems impossible. Is there some way to do this?
As usual, I seem to find the solutions shortly after posting the problem:
Go to SBT installation directory
edit conf/sbtconfig.txt
remove -XX:MaxPermSize=256m
Sadly, Google provides many sbt hits that are either wrong or out of date, so it takes a while to find valid solutions.
This Solution worked for me
Go to project directory
Open directory sbt-dist\conf
Open sbtconfig.txt file and comment below property by putting # prior the line
#-XX:MaxPermSize=256m
There are many solution which show downgrade to java version. You don't need to do just follow above steps . It will work.

sbteclipse: create build.sbt and plugins.sbt

I have downloaded sbt and to resolve the proxy maven repository errors, I have created repositories files with my-maven-proxy-releases: under ~/.sbt
When I do a sbt about, I get the below details:
"~\.sbt\preloaded\org.scala-sbt\sbt\"1.0.4"\jars\sbt.jar"
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] No sbt.version set in project/build.properties, base directory: C:\
[info] Set current project to root (in build file:/C:/)
[info] This is sbt 1.0.4
[info] The current project is {file:/C:/}root 0.1-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4
Now, I wanted to import a project in eclipse and I googled. This is the details I found.
1. ~/.sbt/<sbt-version>/plugins/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")
sbteclipse
2. ~/.sbt/<sbt-version>/plugins/build.sbt
for scala versions and dependencies.
But I am confused on where to create the build.sbt and plugins.sbt as my folder structure is like this:
~/.sbt/1.0
~/.sbt/1.3
and I do not see ~/.sbt/1.0.4 which is displayed in sbt about.
Please guide if my understanding wrong.
First, you need to understand sbt project structure and the difference between project-local and global plugins.
As you would usually use eclipse plugin globally you should put it in
~/.sbt/<sbt-version>/plugins/plugins.sbt
(as you wrote correctly), where <sbt-version> is
0.13 for any sbt 0.13.*
1.0 for any sbt 1.*.* (this may seem unintuitive, but it's okay)
I guess, ~/.sbt/1.3 is just a typo and is meant to be ~/.sbt/0.13.
Also you normally don't put anything in ~/.sbt/<sbt-version>/plugins/build.sbt. If you need to have some global settings (including those for the global plugins), you should put them in
~/.sbt/<sbt-version>/global.sbt
Read about global settings here.
With non-global plugins and settings it's all the same minus the ~/.sbt/<sbt-version>/ part:
use <your-project>/plugins/plugins.sbt for plugins
and <your-project>/build.sbt for project settings

Adding addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1") to my project fails with "Unresolved Dependencies"

I am trying to publish my SBT project to mvnrepository. I am following the directions at these links:
http://www.scala-sbt.org/release/docs/Using-Sonatype.html, and
https://github.com/xerial/sbt-pack
When I add the xerial sbt-sonatype plugin to my build.sbt file:
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
The compiler gives me the following error:
UNRESOLVED DEPENDENCIES
org.xerial.sbt#sbt-sonatype;1.1 not found
Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.11, sbtVersion=0.13) (/richstat/build.sbt#L56-57)
[warn] +- com.github.shafiquejamal:richstat_2.11:0.0.1
My SBT version is 0.13, and I am using Scala 2.11. How can I fix this? Thanks!
You have to add plugins in project/plugins.sbt, because plugins are dependencies of the meta-project, not your library/application.
Check sbt documentation: Using Plugins.
Also regarding sbt version and Scala version: there is Scala version used to compile your project's code (2.11 in your case), and there is Scala version used by sbt itself. The latter is determined by the sbt version: sbt-0.13 uses Scala 2.10, sbt-1.0 uses Scala 2.12.
P.S. I recommend you updating to sbt-1.0.2: just change the version in project/build.properties and use sbt-sonatype 2.0.

sbt unresolved dependency publishing to nexus

I publish my project to nexus/sonatype staging repo. Then I try to pull that dependency with sbt update on another project.
I get an unresolved dependency error. sbt shows me all the directories it tried, including the path for the staging repo I expected to succeed.
I initially thought it was a deployment/delay thing with nexus (waiting for the package to propagate) but I can reliably hit the same pom file link that sbt says failed from a browsers with no problems (cut 'n paste the precise URL).
Does sbt have some kind of resolution cache not cleared by a clean?
If the pom can be downloaded from Nexus then the issue isn't with Nexus, it is with SBT. You might try explicitly running update from SBT to clear it's cache.

How to resolve unresolved dependency (with another/latest version perhaps)?

Apparently the version of a transitive dependency within my sbt project has been bumped - but the direct dependency has not "caught up" with that change.
[error] (*:update) sbt.ResolveException: unresolved dependency: net.sf.py4j#py4j;0.7: not found
The updated (and only available) version is 0.8 (why did they do that is another question.. )
I have attempted to remedy this temporarily by installing the new version into my local maven repo under the old version number of 0.7 - in order to attempt to mollify the dependent library.
mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file \
-Dfile=c:\shared\py4j-0.8.1.jar -DgroupId=net.sf.py4j -DartifactId=py4j -Dversion=version=0.7 -Dpackaging=jar
However, when running sbt yet again, the same error persists. So I need another strategy for dependency resolution.
What about declaring the new version as the dependency in your build and force it (but guess you won't need it as "By default, the latest revision is selected")?
libraryDependencies += "net.sf.py4j" % "py4j" % "0.8" force()
It assumes you've your local Maven repository set up in resolvers - see Resolvers:
sbt can search your local Maven repository if you add it as a
repository:
resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository"

Resources