If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Monday, December 17, 2012

Using sbt plugin for creating IntelliJ IDEA project files (update)

This article contains up-to-date information. I followed the tutorial from the Guardian but there were some issues and I managed to resolve everything. So first we will install the sbt-idea plugin. This time I will install the plugin not on individual project basis but for our SBT installation directly.

First I had to create a plugins folder in my %USER_HOME%/.sbt/ which in below snippet has already been taken care of. Next I created a build.sbt and I added the mpeltonen plugin.
$ pwd
/c/Users/nxp10009/.sbt/plugins

nxp10009@NXL01366 ~/.sbt/plugins
$ ls -la
total 3
drwxr-xr-x    5 nxp10009 Administ     4096 Dec 17 14:14 .
drwxr-xr-x    1 nxp10009 Administ        0 Dec 17 14:13 ..
-rw-r--r--    1 nxp10009 Administ       61 Dec 17 14:14 build.sbt

$ less build.sbt
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")


So next I created a new project according to my previous article and tried to check if everything worked ok. But I soon ran into following issue:
[warn] Host repo.typesafe.com not found. url=http://repo.typesafe.com/typesafe/ivy-releases/com.github.mpeltonen/sbt-idea/scala_2.9.2/sbt_0.12/1.1.0-M2-TYPESAFE/ivys
/ivy.xml
[info] You probably access the destination server through a proxy server that is not well configured.

So I had to configure a proxy for SBT to use. I could have created an alias in my bashrc script but I decided to change the SBT start script and add the proxy to the JAVA_OPTS
nxp10009@NXL01366 /c/development/sbt
$ less sbt
#!/bin/sh
# sbt launcher script for Cygwin and MSYS

JAVA_CMD=java
JAVA_OPTS="-Dhttp.proxyHost=http://your_proxy -Dhttp.proxyPort=8080 -Dhttps.proxyHost=http://your_proxy -Dhttps.proxyPort=8080 -Xmx512M"

....

No comments:

Post a Comment