Unable to find SBT plugin for IntelliJ Idea 12 - scala

I installed scala plugin for IntelliJ Idea 12, but it can't find sbt plugin for it for some reason. Has something changed?

The plugin is not in the default repository, but only in nightlies. Have you followed this (from the blog you link to):
Add the following URL to the list of custom plugin repositories in Settings | Plugins | Browse Repositories | Manage Repositories:
http://download.jetbrains.com/scala/sbt-nightly-leda.xml
It worked for me, after I added this repository I found the plugin.

I wasn't aware of this plugin, and just installed it myself... and it works. What tripped me up while installing is that there are a few third party SBT plugins floating around out there as well. The one you want is called "sbt-intellij-bin-0.1.49" (or some later version). Not SBT Executor, et al. Make sure you add the repository referred to on that webpage.
Install, restart IntelliJ. You should see an 'SBT Console' button along the bottom of the interface. Nice.. now I don't have to have a terminal window open to SBT taking up screen real estate...

Related

How to use existing Scala with Intellij

I already have brew install scala - I am able to run Scala via command line. After that I installed IntelliJ version 2016.1.3
While installation process of IntelliJ, I was asked to install Scala plugin but i clicked no - because I already have Scala installed
Now I am trying to figure out where exactly we can create a Scala application with the use of my existing Scala installed. How and where in the IntelliJ can I set this up? I can only see Java projects available to be created.
Thanks
You can't. The Scala you have installed is a completely different thing from the IDEA Scala plugin.
The Scala plugin is what you need to handle Scala projects, editing Scala files, etc. in IDEA. The command-line Scala is just the compiler and the standard library, it doesn't know anything about IDEA.
Also, for the command line you should install SBT instead of working directly with the Scala compiler unless you want to handle dependencies, classpaths, etc. manually (you don't).
If you want to create Scala application using IntelliJ IDEA, you will need to install the Scala Plugin.
Step 1: Open IntelliJ Preferences or Settings
On Mac:
Open IntelliJ IDEA.
Then click on the menu item IntelliJ IDEA and select Preferences.
On Windows:
Open IntelliJ IDEA.
On the bottom right corner of the Welcome to IntelliJ screen, select Configure.
Step 2: Find and install Scala Plugin
After opening the Preferences or Settings screen from Step 1, click on the Plugins section on the left panel.
Then click on the Install JetBrains plugin… button.
This opens another window which has a Search box on the top left corner. Type in Scala in the search box and this will list the Scala plugin which you need to install.
Hit the Install button to kick off the installation.
Do not forget to Restart IntelliJ following the install.
And Voila! You should now be able to create Scala projects in IntelliJ.
For further instructions on how to install Scala plugin in IntelliJ, you can follow the instructions from www.allaboutscala.com

how to use intellij-leiningen-plugin in intellij idea 14

I don't know how to use leiningen plugin in IntellJ Idea14.
I have tried 2 ways:
I have downloaded from http://github.com/derkork/intellij-leiningen-plugin
and now how to use it
I have installed in config/plugins/Browse Repositories
but when I create new project
I can't see any leiningen project?
How can I fix it?
This plugin has been unmaintained for a long time. It's officially been replaced by Cursive, whose lein support was initially based on the source code from this plugin. It was generously donated by the plugin authors.

How do I run SBT from within Eclipse?

So far I've been running IntelliJ IDEA Community Edition for my Scala projects, but as my projects are expanding in complexity, I stumble upon more and more roadblocks with the IDE.
Like for example the simple fact that IDEA doesn't allow for web-development or Java EE development what so ever, which means using the Play Framework or TomEE in Community Edition leads to nothing but dead ends and frustration.
The only reason I switched to IDEA in the first place, is because of its excellent plugin system, allowing me to run SBT seamlessly as the primary scala compiler and library downloading tool with ease.
Searching around on Google, however I can only seem to find mentions about the eclipse plugin for sbt, that makes an sbt project Eclipse friendly, which is the exact opposite of what I'm really looking for.
I'm not willing to spend €89 per year for a student licence after all the pain it's put me through so far...
So my question is; is there a plugin for Eclipse that allows me to use SBT the same way as in IDEA? Or am I forced to go through the console?
There may be some movement in this direction in the future, but for now there is no such plugin.
Currently there is no Sbt plugin for Eclipse. Depending on your use-case, you could:
use the Eclipse builder
Pros: proper integration (error markers in Problems and editors, cancelation, progress reporting)
Cons: may get out-of-sync with the Sbt build file (when adding a dependency, for example), doesn't handle anything other than Java and Scala (like Play templates or route files)
use Sbt on the command line (make sure to disable auto-building in Eclipse)
Pros: can handle complex builds, classpath is always up to date
Cons: no integration (see above)
use Activator
Same Pros and Cons as Sbt, but with a pretty UI
We are working on an sbt-server plugin for Eclipse, which will delegate the build to an external Sbt process without giving up the convenience of integration. We hope to have something out towards the end of this year.
I think the main problem you are trying to solve for is too have sbt jar dependencies show up and get used natively by your eclipse project. You can do that with the IvyIDE plugin (which is found in the eclipse marketplace).
If you have that installed (and the eclipse plugin for sbt) then this closes the gap between systems.
To enable:
type the {sbt deliver-local} command from your terminal. This adds an ivy xml in your project's target directory
right click on your project. Choose the Ivy -> enable Ivy dependency management option
go into your projects properties. Highlight the Ivy property. Click the new button and navigate to the ivy xml file in your projects target directory.
Now your eclipse compiles off of your sbt managed dependencies and now you are doing everything you want except actually running sbt from within eclipse (which you only have to do now when you are changing dependencies)

GWT+Eclipse without GWT_CONTAINER

The situation
I'm using GWT with Eclipse and Google Plugin for Eclipse (GPE).
Gradle is the build tool and the Eclipse classpath is generated by Gradle. As I have no "com.google.gwt.eclipse.core.GWT_CONTAINER" on my classpath, GPE always shows the error "The project 'Test' does not have any GWT SDKs on its build path" and the Console sometimes prints "GWT SDK not installed.".
Annother effect is that Eclipse doesn't let me GWT-compile the project (but running dev mode works fine). But that one is ok for me, as I compile using Gradle.
Things I'm aware of
I know that I can exclude all GWT depedencies from the Eclipse classpath and add the container through Gradle (I did that for other projects). But as I can't enforce the GWT version provided by Eclipse (I can only specify the SDK's name in the classpath by adding the suffix "/" to the conatiner), I think thats an ugly solution. Another point is that the GPE update site only lists the latest GWT version available. There's no way to automatically install an older version (yes you can provide one externally).
When using GPE together with Maven and m2e it simply works: GPE links no real SDK for Maven projects but there's a link to the "com.google.gwt" group in the local Maven repository. But that's magic I can't use because:
Gradle's local repository format is different to Maven's
This logic is implemented in the plugin "com.google.gdt.eclipse.maven" and I can't use that without adding a pom.xml to the project
The questions
Is there a possibility to deactivate this nasty error without loosing other GPE features?
Is it possible to do something similar to what GPE+m2e does without
creating my own Eclipse plugin?
Am I right that excluding the jars and adding the container is the only viable solution by now?
You can adapt this library to launch with custom classpath and other settings: https://github.com/eclecticlogic/gwt-launcher

Eclipse running lift project (project configuration issues)

Trying to get a lift project to run on windows, I've installed maven on my computer, then tried to use
mvn archetype:generate from cmd, then chose the lift basic one , but it always failed on the jetty:run part. Before that, I had to change a lot of the pom.xml file to even get a successful build (since the tutorial I was using was obsolete and it couldn't find the dependencies).
So I've decided to try with the eclipse plugin, thinking it should be easier.
I've installed the maven plugin for eclipse and created a project with the lift archetype.
The project was succesfully created, but I have all kinds of errors in the editor for missing ; and so on (I have scala ide installed on eclipse also and creating a normal scala project works and compiles/runs fine). I have also tried to include the scala-library.jar in the buildpath, with no change.
The odd part is that I can run the cmd and go to the project folder, then run mvn jetty:run and it will actually work (?!) Trying to run in eclipse with jetty:run as goal will give me ClassNotFoundException on the HelloWorld snippet.
So what might be wrong with my settings?
UPDATE: no luck whatsoever, after trying 3 different eclipse versions, installing the maven for scala plugin and following every tutorial I could find. It just simply feels all is outdated on the instructions:
this is how it looks after I include the scala libraries for eclipse on every project (after I create it from an archetype):
is this "mvn archetype:generate" up to date? I don't know if anybody guarantees it will work at all..
Anyway, the default way to at least try Lift and see it working is the following: https://github.com/lift/lift_25_sbt
It uses "Simple Build Tool" instead of maven, but maven should work, too. Also, you can easily read "build.sbt" to get all the dependencies.
Plugins for creating eclipse/intellij project definitions are included. (See the README of the demo project.)
The target to create eclipse project is "eclipse" or "eclipse with-sources=true".
The target to launch the app is "container:start".