Transitive Maven dependencies

Howdy,

We recently refactored the Lift Maven layout to remove redundant declarations.  One of the redunencies we removed was the declaration of scala-library from all but the lowest dependency (lift-common).

When I open up Lift in IntelliJ (8.1.3 with the latest Scala plugin), all the Scala stuff (e.g., List, PartialFunction, etc.) is marked in red as not found.

Is there some setting that causes Maven dependencies to be searched transitively?

Thanks,

David

0
8 comments

That should be the default.

Look at Project Structure -> Modules -> Lift Common -> Dependencies. Do you see scala-library / scala-compiler? Do they have 'export' checked? (This is the IntelliJ 8 equivalent of a transitive dependency).

Next look at Project Structure -> Modules -> Lift Module XYX -> Dependencies. Do you see a module dependency on lift-common? Jar dependencies on scala-library / scala-compiler?

Also check under Module XYZ, Scala (This is a 'facet', visible in a tree view in the module list). In the latest versions of the plugin, there is an option to 'use scala compiler from specified jars'. I'm not sure if this is back-ported to the version 8 plugin. For a maven project like Lift, it should be unchecked, you want to use scala from the classpath.

As a sanity check, you should also run a mvn dependency:tree to check that the pom config is indeed transitive...

-jason

0

Thanks.

For some reason, when I blew away all of IntelliJ and it's cache, etc. things worked without having to explicitly check the "export" box.  On the other hand, your answer was wicked useful 'cause it let's me crawl around the underbelly of IntelliJ.

0

Hi David,

Is there going to be an update to your "IntelliJ update" blog entry or is your opinion the same?

Thanks,
Jon

0

I am trying my hardest to like IntelliJ.  I really like the code navigation.  I am still struggling with the editor (1) putting spurious characters in the file (I think it's because I do Ctrl-F Foo so fast that "Fo" winds up as a turd in the file) (2) autosaving (there really no way to stop it from not prompting you to save a file) (3) not picking up filesystem changes in open files (this is a huge problem when using a bunch of different branchs in Git and hopping between them).

I would love to give IntelliJ a thumbs up, but I just can't.  Maybe version 9 will be better for me.

0

For 2/ this is a "characteristic" of IDEA, which I've come to love. If you ever want to go back to "pre save" state, you can just dip through the Local History
FOr 3, it works perfectly well for me, on WinXP.

0

Re: auto-saving: Eclipse (I am not an Eclipse lover, I love TextMate and Emacs, but they don't have code completion or real-time error reporting, thus harder-core IDE time, plus I do most of my development on Linux, so I don't have TextMate as an option)... anyway... Eclipse has a history feature as well, but it does not have auto-save... the two do not have anything to do with each other.  The problem with auto-save is related to the text turds that appear in the files.  If I don't know the turds are there, they get saved, they get promoted to Git, they get put in the master repository.   This breaks builds.  Before you say, "you should check your stuff before committing", keep in mind that I run a fresh build before committing.  However, builds can take 10+ minutes.  I often do Lift-related tech support during a build.  So, if I search through files that are part of the early build process while the build is happening, turds show up in the files, the build succeeds, I do a commit, turds show up in commit.  This is a tredendously bad problem.

In terms of #3, I'll work up a repro case and post it to the appropriate forum.

0

3) Just checking that your setting for "Synchronize files on frame activation" is turned on. It is under Settings > IDE Settings > General > Synchronization. You can also do a manual synch. How are you hoping between the Git branches? I've seen people have trouble using two computers and a remote mount so they never actually leave IntelliJ to perform an update from the other computer. I've also noticed problems with synchronization sometimes not happening if you have a file open that is not under in the project/module.

2) You can turn off the two types of automatic file saving. These are also under the same Synchronization section: "Save file on frame deactivation" and "Save files automatically if application is idle for ...." As Thibaut says, though, many people eventually come to appreciate auto-save despite originally being disturbed by it.

1) You end up with text-turds doing a file-local search on your Mac? I'm on a Mac but haven't run into that one yet.

Local history is independent of auto-saving.

Cheers,
Jon

0

I will re-check the filesystem sync.  I am running from a fresh install of IntelliJ 8.1.3

File saving:  even if you disable the file saving when you lose focus, the files are still saved when you quit the IDE... I often quit the IDE just before doing a commit.  Sorry, but the inability to force IntelliJ to prompt me to save a changed file is a serious defect.

The text turd issue is on Linux.  It's not like I have a slow machine (it's a Core i7 with 12GB of RAM... so it's not swapping and it's got lots of processors idle).

0

Please sign in to leave a comment.