Buildship and Eclipse project dependencies - eclipse

We are using eclipse and a buildserver activly. We switched to gradle on the buildsystem first. Therefore we wrote for each eclipse project a gradle file. Using a artefact repository to which it is published, everything worked fine.
Now we are switching our IDEs to buildship. Building a single project works fine. However how can I reference in the build.gradle another eclipse project, without building it first on the buildsystem?
Thanks

Related

How to make Android Studio and Eclipse coexist (gradle dependencies)

I need to use Eclipse and Android Studio on the same computer, simultaneously, for different projects.
The Eclipse project is Enterprise Java deploying on Payara (Glassfish) via the WTP toolkit and Deployment Assembly. When setting up the project I build with gradle build and gradle eclipse, which pulls all the required dependencies and configures the Deployment Assembly in Eclipse. However, I believe that any incremental code changes thereafter are compiled by Eclipse without using gradle (e.g., when I save a file).
Android Studio always compiles with gradle.
The issue that I have is that every couple of weeks, when I compile my Android Studio project, gradle decides to delete all my Eclipse project dependencies. My guess is that it thinks that they are not in use any more, since Eclipse compiles outside gradle. This results in my Eclipse workspace pointing to libs that are no longer there.
If I manually run gradle build in my Eclipse project dir, my dependencies are restored and Eclipse no longer complains. But something seems to be cached wrong somewhere so after this my web app will no longer deploy on the server. At that point my workspace is effectively corrupted and to this day I haven't found any workaround, other than to delete it and start all over again. Which is *A LOT* of work to reconfigure.
Any help will be greatly appreciated.

Converting playframework project to eclipse project when it contains errors

So I am doing major change in a library(maven) which I have developed, and using it in one of the playframework project.
I have finished refactoring changes in maven artifact, published it to repository with new version.
Now I want to see where all this will give errors in play project, so that I can go and fix 100s of such errors. Ideally I would like to use eclipse or some IDE to report me all the errors, so that I can easily navigate and fix.
But problem is that eclipse doesn't know about new library version. To tell that to eclipse I have to upgrade library version in build.sbt, compile and re-create eclipse project. But since it contains many errors, I can not create eclipse project before fixing those.
Is there a way to visualize all those errors in eclipse or any IDE in such cases?
You did not mentioned, if the play project is a maven project as well. I am working with play as a maven project, which is created like this. But I suppose, that with non-maven project the following works as well.
From the command line run:
activator eclipse
In eclipse do 'refresh' to the project. Now you can see all the errors caused by the changes in your jars.

Gradle Buildship won't download dependencies

I am used to using the Eclipse Gradle plugin by Pivotal in Luna, but now that Mars was released I am trying to use Buildship. However, I have not yet figured out how to refresh my project's dependencies.
I know that the project is set up correctly because it worked perfectly fine in Luna with the other plugin, but although importing into Mars was simple, I am getting errors because none of the dependencies have been downloaded. Am I misunderstanding the purpose of Buildship and I should switch back to the plugin by Pivotal, or am I overlooking something?

Is it possible for Gradle projects in Eclipse/STS to resolve dependencies to other Gradle projects in the same workspace?

A Gradle project in my workspace (call it Downstream) needs to depend on another Gradle project (call it Upstream). Outside of Eclipse, of course Upstream would need to be build and installed before Downstream (so that Gradle can resolve it). In Eclipse, since both projects are in the workspace together, I'd like to have Gradle look in the workspace first and make the dependency between the projects, not from the repo.
m2e (Maven integration for Eclipse) does this (the option is called Resolve dependencies from Workspace). Gradle Eclipse plugin has an option called Remap Jars to maven projects but that seems to do this for pom-driven m2e projects, not other Gradle projects.
Is there any way to get Gradle to resolve dependencies to the local workspace (when they're present) instead of the repo?
It turns out this is was an outstanding feature request for Gradle IDE. It has been delivered for the 3.6.3 release of Gradle IDE.
You do have to enable it, though:
The feature has to be enabled in the Gradle preferences page. Access
via "Window >> Preferences >> Gradle".
If you are not seeing the "remap jars to Gradle projects" there then
maybe double check that version of the Gradle plugins is indeed 3.6.3.
Maybe something went wrong during the upgrade and you are still using
an older version.
Source
As far as I know these is no such functionality in current STS plugin. Given that there is the re-mapping support to replace dependencies with reference to m2e project I think it should be possible to add it.
Modifying the generated classpath using XML hooks in EclipseClasspath model descrideb in http://www.gradle.org/docs/current/dsl/org.gradle.plugins.ide.eclipse.model.EclipseClasspath.html will probably not help because this is done in Gradle process where you do not have information about existing Eclipse projects from your current workspace.

Eclipse dependent projects not copied to WTP deployment

Before we started using Gradle, a multi-project (10-12) development effort within Eclipse successfully deployed, via a WTP project, to one of the internal Tomcat 7 servers. We find this very useful for development.
With Gradle up and running the dependent project's jar files are no longer being copied to the ../WEB-INF/lib directory. I don't believe this has anything to do with gradle as it is completely out of the picture later on, but it is different, so I am mentioning it. Building the standalone war file works perfectly as does "gradle jettyRun".
If I add the project facet "Utility Module" to the dependent projects within Eclipse then it works. However, I don't recall that this was ever done initially. Ok, this also really complicates the generation of the eclipse projects from gradle as well!
I can live with it, but was wondering if anyone knew if it has to be this way or if there is some alternative.
Thanks - versions: eclipse Indigo SR2, Java 1.7, Gradle 1.2
I've run into this problem as well: An Eclipse WTP project that depends on other projects won't deploy those projects' dependencies unless they are WTP projects as well.
This is far from an ideal solution, but in my own build scripts, I work around this by using the eclipse-wtp plugin instead of the eclipse plugin:
allprojects {
apply plugin: 'eclipse-wtp'
}
There are a couple of bugs related to this: GRADLE-1880 and STS-2192.