I'm trying to use gradle in Eclipse.
Here's what I did, I installed "Gradle Integration for Eclipse" and "Buildship Gradle Integration".
After that I tried importing my project like so:
But my project now only exists out of some generated files, not my actual project...
All I want is have Gradle import the libs for me. I appreciate any help.
Related
Similar issue to this issue but it seems to be a maven/eclipse project issue.
I am using eclipse neon to check out from git, like this:
File -> Import
Maven -> Check out Maven projects from SCM
Now give it the url as below:
I am using the following public github repo and I am seeing that Maven m2e during git checkout is not working, I get issues like the screenshot here where "import org.springframework.*" items are not being imported. All of this "just works" when I build with "mvn clean install" from the commandline, but is failing inside eclipse:
I have tried to refresh, and can't figure out any other action which might clear this issue up from inside "m2e" (maven to eclipse) integration in Eclipse Neon.
The projects appear to have "maven nature" but are not buildable. I checked in the project properties and I don't see any errors in the Builders or Java Build Path. I also tried this with Eclipse Mars.2 and had no luck with it either.
I built a libgdx project on my desktop which I can build and run properly though I want some friends to work on the project with me and when they import the repository from github the project won't run and it loses the gradle build.
I have tried to use these gradle commands to rebuild the project with no success.
cd/(File path)
gradle build
gradle eclipse
After I try to do these commands eclipse loses the project file. Even if I copy my master file into the imported directory it doesn't work.
Does anyone has suggestions on how to fix this?
Thanks in advance.
What do you mean with "it loses the gradle build"?
Try using ./gradlew (or gradlew on Windows) instead of gradle. The Gradle Wrapper scripts use arcane magic no mortal presumes to understand, but they seem to have their purpose.
When I use Maven compile, it will automatically download the depended java packages for me. Now, to debug the project, I import the project into Eclipse, but in Eclipse, the depended package is still missing. How can I get the packages? Or, can Eclipse use packages downloaded by Maven?
You don't really need to manually add all the dependencies downloaded by maven to the classpath in Eclipse. There is a maven-2-eclipse plugin which integrates maven with Eclipse. Using that plugin you can
import/create a project as Maven project or
convert an existing project into a maven project
Your Eclipse will automatically add all the downloaded dependencies on the class path everytime.
An alternative to the m2e eclipse maven plugin suggested by rocketboy is to use the maven eclipse plugin. This works from the command line (mvn eclipse:eclipse), and generates Eclipse settings for your project by downloading dependencies and putting them onto the Eclipse build path.
I'm new to IntelliJ. What is the best (and recommend method) for importing project into IntelliJ. Is there a maven plugin for doing this?
More specially I'm interesting in importing this project.
https://github.com/nathanmarz/storm-starter?source=c
Thanks.
UPDATE 1 - When I try to use File -> open (the m2-pom.xml file) it just opens the xml file (as shown in the screenshot below.
It looks like that project has a pom file named m2-pom.xml. You should import that as a maven project. Assuming it's using standard repositories, you'll immediately be able to compile the code with maven.
You can select Open in the menu, and then choose that file and it should load the project.
Be aware this seems to be a clojure project. You might want to research the La Clojure plugin to see how/if it can import clojure projects with it. It looks like the steps I gave will work, but the code may not run very easily for you without the La Clojure plugin.
You could either import the Maven project inside of IntelliJ (File -> Import Project...), or you could simply use the Maven IDEA plugin. All you do is execute mvn idea:idea inside of the Maven directory, and a project file will be generated. This file may be opened as a project inside of IntelliJ.
EDIT: #maba warns not to use the Maven IntelliJ plugin.
I imported a Maven project into Eclipse. I was able to deploy it from the command line. In Eclipse it is full of red Xs. I have cleaned the project, updated the configuration and I ran the following command:
mvn -Declipse.workspace=<pathtoworksapce> eclipse:add-maven-repo
and I still have the same problem. The project is dependent on another project.
What I ended up doing was removing all of the projects in Eclipse, but not deleting the source files. Then instead of directly importing the code as Maven->Check out as Maven Projects with SCM, I selected Existing Maven Project and imported the code from my local machine. This got rid of the errors, but when I would right click on code and select "Open Declaration", I would get Error: Could not open the editor: The file does not exist" So I removed all projects again and this time I deleted all the ".project" files and repeated the import Existing Maven Project. So now there are no red Xs (dependency problems) and the lookup functionality within the code works.
Go to your master project and type the following :
mvn install
mvn eclipse:eclipse
After that, import your project. You can also install m2eclipse for better support. If you use gwt or any other framework which has a custom maven execution, you should also install plugins for those in Eclipse.