Intellij: Gradle dependency not found - intellij-idea

How would I solve this problem where the dependency can't be found? I have the library on my PC, I just don't know how to import it into my project.
Thanks!

Related

unable to import dependencies in kotlin multiplatform project

Intellij Version: 2019.3
I am new to Kotlin-native development and would greatly appreciate any help I get. I created a Kotlin native/gradle project and I added the okhttp dependency to the project and I did not run into any issues in doing so.
But I am not able to import the okhttp library into the source. I keep getting "Unresolved reference: okhttp".

Gradle dependencies not added as libraries in IntelliJ

I created an intellij Gradle project for some groovy code. Gradle correctly resolved the dependencies and has them added in the Project Structure's modules tab, however they are not loaded in the Libraries tab... Because of this it is impossible to compile the project, it gives me errors on missing libraries. What am I doing wrong?
I'm not an expert on this, having only just discovered a solution to this problem myself, but I found that using the idea Gradle plugin resolved the same issue for me.
So, in build.gradle add:
apply plugin: 'idea'
Then run:
gradle idea
and Gradle will create the .iml files for your project, which Intellij will understand and use to import the libraries. I'd recommend creating a backup of your project first, because if there are other things in your .iml files that Intellij needs, I suspect everything will break! I find them a bit of a mystery, personally.

Gradle multi-project builds and IDEA, are modules not automated?

I was doing some experimenting with Gradle and created a multi-project build, with multiproject_test dependent on two projects ChildA and ChildB. I put this simple test project on GitHub.
https://github.com/thomasnield/gradle_multiproject_test
Everything seems to be working great on the command line and Eclipse. Everything was compiling and the dependencies were being recognized and used. But when I imported the project into IDEA it did not create the dependencies. It seems like I had to manually create the modules although it did import the source code from the child projects.
My question is do I have to specify these module declarations separately in the build.gradle script for IDEA? Why would it not even compile the dependencies?
UPDATE
Solution proposed below worked great. IDEA handled the build.gradlescript much more gracefully than the idea plugin.
Loading a Gradle project to build an IDEA project by using the idea plugin does not always work well. The recommended way to load a Gradle project in IDEA is to import the build.gradle file from the root project.
More detailed instructions can be found in IDEA documentation here.

Seemingly no gradle import support in IDEA

I have the full version of IDEA 12.1.6
I am trying to import the gradle project https://github.com/Synesso/jomsocial-automation-test
The import doesn't recognise the project as a gradle project. No dependencies are linked, the java profile is ignored and there is no jetgradle window.
In the IDE settings the only thing that matches a search for "gradle" is the gradle plugin, which is installed by default.
I think I need to configure the IDE to support gradle imports, but can't find what or where.
That is strange. Anyway, the Gradle support in IntelliJ 12 is very limited. You are better off with Gradle's idea plugin or IntelliJ 13 (EAP), which has much better Gradle support.

Eclipse can't resolve a maven-bundle-plugin produced dependency

I made a bundle for a third-party lib with the maven-bundle-plugin as described here: http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp02/build01/pomfirst-thirdparty/pom.xml.
I can build my third-party lib and use it in another eclipse-plugin project which is build by the tycho-maven-plugin and whose dependencies are resolved by the target-platform-configuration plugin. So far so good.
But my eclipse can't resolve this dependency.
I think you are facing the problem explained in thread Eclipse support for pomDependencies=consider.
The suggested solution is:
You need to import pom-first projects into workspace, there is no
integration between PDE workspace target platform and Tycho
pomDependencies=consider feature.