问题
I installed Intellij IDEA 15.0.4 + Scala plugin (2.2.0) on a computer with an internet connection, created a new SBT project and all the external dependencies were added to the project:
i.stack.imgur.com/v560H.png
However, when I try to do the same thing in our issolated network (no internet) against our Artifactory server, I got the following message:
Error:Error while importing SBT project:
...http://zzz:8081/artifactory/scala_local/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar:::::::::::::::::::::::::::::::::::::::::::::: :: UNRESOLVED DEPENDENCIES :: :::::::::::::::::::::::::::::::::::::::::::::: :: org.fusesource.jansi#jansi;1.11: not found ::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS unresolved dependency: org.fusesource.jansi#jansi;1.11: not found Error during sbt execution: Error retrieving required libraries (see C:\Users....sbt\boot\update.log for complete log) Error: Could not retrieve jansi 1.11
See complete log in C:\Users....IdeaIC15\system\log\sbt.last.log
So I figured I need to get jansi 1.11 up to Artifactory (to /org/fusesource/jansi/jansi/1.11/). After uploading jansi to Artifactory, I refreshed SBT and started getting the following message:
Error:Error while importing SBT project:Error during sbt execution: No Scala version specified or detected
So I'm guessing it has something to do with the fact that Scala is not available in Artifactory? If that's the reason, it seems unreasonable to upload all the jars to their respective paths manually, and I couldn't "guess" the path in my many tries... So I'm pretty sure I'm doing something wrong here...
This is my build.sbt:
name := "untitled"
version := "1.0"
scalaVersion := "2.10.4"
This is my .sbt\repositories:
[repositories] local my-ivy-proxy-releases: http://zzz:8081/artifactory/scala_local/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases: http://zzz:8081/artifactory/scala_local/
(sorry for the layout, won't let me post more than 2 links...)
I checked some similar issues here, nothing seemed to help...
I'd appreciate your help on what I should check / read on... Is there a way to automatically deploy all the dependencies to the correct path in Artifactory?
***EDIT: Ok, so I removed .sbt\repositories file, invalidated the IntelliJ cache and restarted, created a new SBT project... This didn't seem to help, also now it seems that it doesn't recognize the build.sbt syntax anymore... Even when I add the resolver, it completely ignores it... I manually deleted the directories in /.sbt/boot/other/ (had jansi and scala-sbt there), and now it can't resolve jansi again, only this time it tries to connect to repo1.maven.org... :
Error:Error while importing SBT project:<br/>...<br/><pre> https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.11/jansi-1.11.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.fusesource.jansi#jansi;1.11: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.fusesource.jansi#jansi;1.11: not found
Error during sbt execution: Error retrieving required libraries
(see C:\Users\...\.sbt\boot\update.log for complete log)
Error: Could not retrieve jansi 1.11
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0</pre><br/>See complete log in <a href="C:\Users\...\.IdeaIC15\system\log\sbt.last.log">C:\Users\...\.IdeaIC15\system\log\sbt.last.log</a>
Thanks, PA
回答1:
We encounter a similar issue.
What finally solved the problem was removing .sbt\repository file. Then all dependency could be resolved with the default repositories.
回答2:
It is the problem of IDE you are using specially the scala plugin in it. You can get ride of this just go to the folder where the build.sbt is created. Delete the "project" folder and open cmd, run "sbt" command on the folder, a new project folder will be created. Now you can open that in IDE.
It may be that you may find some problem very first in ide, if you build the project once , all the problems will go away.
来源:https://stackoverflow.com/questions/36062570/configuring-intellij-idea-15-0-4-and-sbt-0-13-7-with-local-artifactory-server