Maven/Gradle support in IntelliJ Plugin - maven

I'm writing a plugin using IntelliJ SDK via the gradle-intellij-plugin.
I was able to add the dependencies so far, but now that I'm trying to add Maven/Gradle dependencies they are not seen.
I also added the jars of the IntelliJ plugins into the SDK classpath
Any idea of the reason? How can I introduce support for these Maven/Gradle thingy?

The approach that you are shown is for those that are not using the gradle plugin to build new plugins.
According to the plugin README and to the IDE structure, these two are bundled plugins and must be imported using the folder name inside the plugins folder in the IntelliJ installation.
Just add
intellij {
version = 'IntelliJVersion'
pluginName = 'MyPluginName'
plugins 'Maven', 'gradle'
}
in the build.gradle.
Pay attention to the case.

Related

IntelliJ IDEA: installing dependencies without build tools?

How can you set up dependencies (the jar files that we usually grab from maven repository) in intellij, without using a build automation tool? Do u download them and install them in you're desktop and somehow connect them to the project you're working on in intellij or you're IDE of choice?
IntelliJ IDEA has a feature that allows to add a library from Maven into the project that is not using Maven. It will download the jars for you. You can also download the files manually and add them to the module dependencies from the disk.

Why does my gradle download sources by default?

I converted my maven project to gradle with gradle init. Now every time I import the same project into my IDE, gradle downloads the same dependencies from the scratch, and what's worse is it also downloads the sources, I have no idea where that was configured, I am using IntelliJ, but I didn't configure anything related to gradle. How can I let gradle cache the same dependencies and not download sources?
You can disable downloading sources in your Gradle config file when using 'idea' plugin. See: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html (search for 'downloadSources').

Where to download Netflix Astyanax dependencies?

I want to include Astyanax into my project. I checkout the code from github and compiled it with "gradlew build". I am not familiar with gradle.
I include the Astyanx jar files manually into my project. When I run it, it complains about missing Jar.
I wonder, where I can download all the dependencies bundle for Astyanax?
Java library projects often don't provide a single download location for their dependencies. Instead, you would typically use a build tool that supports Maven repositories (e.g. Maven or Gradle) for your own project, which would then automatically download required dependencies behind the scenes.
If you do want to get hold of all dependencies for the Astyanax project, try to add the following to its build.gradle:
task copyLibs(type: Copy) {
from configurations.runtime
into "libs"
}
Running gradlew copyLibs should then copy all (compile and runtime) dependencies into the libs directory.

What should be in the build.gradle file to support imports of the standard groovy libraries

I had created a groovy project. It worked by itself.
After some additions I had to add a new jar of a new library into the imports.
While the whole workspace runs on Gradle, I added the appropriate Maven reference to the gradle.build file.
After running gradle cleanEclipse Eclipse the new library works OK.
But. All project references to the Groovy libraries disappeared. Foolish me, I had to put some references to them into the gradle.build, too.
The list of libraries:
groovy.util.slurpersupport
groovy.xml
org.codehaus.groovy.tools.xml
groovy.lang
But I don't know how to include them into gradle.build. I can't found them in maven repository. And even so, I have them installed in my Eclipse, and I should take these. And I can't google any help, because gradle groovy gives the results on how to call gradle from groovy, not vice versa.
Moving from plain Groovy to Gradle won't help, it is really about gradle support for calling a java library from groovy.
I have nothing against getting dependencies from Maven rep., but I don't know how to do it in my case - The problem is, that I have Eclipse 3.6. And I should use the last version of groovy for Eclipse 3.6. So, I have installed it from http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/. And I don't know what is the equivalent version in Maven - there is no info about it.
There was some error in the groovy in Eclipse installation. Now after running gradle cleanEclipse Eclipse while build.gradle has NO dependencies to groovy, almost everything runs OK, I only have to add the groovy nature to the project

Can not import packages at plugin.xml from jars which are loaded as maven dependency?

I would like to take advantage of the features that Maven provides for managing dependencies in a project. My brief understanding of how Maven works is that it will aquire the JARs needed and then build the project with these libraries. So i have installed and configured maven on my computer. Also i have installed the me2eclipse plugin version 0.12 on my eclipse helios.
I have been created a maven project and configured the pom. I added some dependencies to maven and maven was checking out the dependend jars to %userprofile%/.me2/repository. This works fine. But i would like to import some packages from the jar files which are located at the maven dependencies at my plugin.xml which are used by running a eclipse rcp plugin. The maven dependencies are added to my classpath as well.
I don't know were the mistake is? Can any body help my. Thanks.
The answer is, thats not possible to import some packages from jars or bundles which are loaded as maven dependency (stored at the maven local repositiry) at the eclipse rcp plugin dependency or MANIFEST. You can only import bundles or packages from jars which are located at the eclipse target platform. So the solution is to add the bundles which ar located at the local maven repository to the target platform as well.
You should take a deep look at Maven-Felix which supports you in this kind of building. Furthermore i recommend you to update to Eclipse-Indigo and use the integrated (Marketplace) m2e instead of the old m2eclipse plugin.

Resources