Comments (7)
Ah, this might be a special case related to #50, when you have the same dependency as compile and transitive test dependency. Thanks for reporting!
from sbt-idea.
Just to make sure, is this actually a problem in Idea? I.e. the test-scoped dependency is not seen by the non-test classes of User project in Idea?
from sbt-idea.
I think this shouldn't be an issue(?). I just tested in idea, and "Test" scope does not prevent a dependency from not being seen by production code in dependent project. Only if I removed "Exported" -flag, then the dependent module did not compile. Or am I missing something?
from sbt-idea.
They are seen in the IDE itself, but not while running. So for example, if this is in user/src/main/scala/Main.scala:
object Main {
val log = org.slf4j.LoggerFactory.getLogger(getClass)
def main(args: Array[String]) {
log.info("Hello world")
}
}
then there are no red squigglies, and SBT compiles it too of course, but when it comes time to run:
/usr/lib/jvm/java-6-openjdk/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:38881,suspend=y,server=n -javaagent:/home/robertm/idea-IC-103.255/plugins/Groovy/lib/agent/gragent.jar -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/java-6-openjdk/jre/lib/charsets.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/jsse.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/jce.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/management-agent.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/resources.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/javazic.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/compilefontconfig.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/about.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/pulse-java.jar:/usr/lib/jvm/java-6-openjdk/jre/lib/ext/dnsns.jar:/usr/share/java/gnome-java-bridge.jar:/home/robertm/simple/user/target/scala_2.8.1/classes:/home/robertm/simple/project/boot/scala-2.8.1/lib/scala-compiler.jar:/home/robertm/simple/project/boot/scala-2.8.1/lib/scala-library.jar:/home/robertm/simple/library/target/scala_2.8.1/classes:/home/robertm/idea-IC-103.255/lib/idea_rt.jar Main
Connected to the target VM, address: '127.0.0.1:38881', transport: 'socket'
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at Main$.<init>(Main.scala:10)
at Main$.<clinit>(Main.scala)
at Main.main(Main.scala)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 3 more
Disconnected from the target VM, address: '127.0.0.1:38881', transport: 'socket'
Process finished with exit code 1
Comment out the dependency in the Library project, reload/update/idea, and it runs fine.
from sbt-idea.
Ok, so the scope affects runtime classpath, like it obviously should. Good enough reason to fix it :) Thanks!
from sbt-idea.
Could you test 0.5.0-SNAPSHOT, if it fixes the issue for you?
from sbt-idea.
I can, and it did. Thanks!
from sbt-idea.
Related Issues (20)
- Wrong resolution of transitive dependencies from invalidated snapshot dependencies
- projects using sbt-multi-jvm dont get set up correctly HOT 3
- Plugin apparently ignoring custom repositories configuration
- Multi-project "test" dependency listed as "compile" dependency in IntelliJ HOT 1
- Source generators trigger creation of incorrect source folders HOT 1
- Is there a way to mark `gen` as Generated Sources Root after SBT refresh? HOT 3
- Download sbt plugins' sources, too? HOT 4
- An error to find a sources/jar file should not stop project file generation HOT 1
- Configuration of java annotation processors
- Account for multiple project dependency configurations and ideaExtraTestConfigurations
- support for intellij idea 14 HOT 12
- Multimodule project in Intellij 14 fails to build
- generate idea 14 project HOT 4
- 1.6.0 not found
- REQUEST: add more details to readme.md HOT 2
- Problem on Java8/OS X 10.10
- The pluginPaths option is output as absolute path and not relative path
- bundle dependencies downloaded into jars folder as well as bundles folder
- Sbt-idea for scala 2.12 HOT 3
- how to use it in Idea 2018? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-idea.