How to make git project as Android Project? - java

I receive projects from github.
They are android project. But they does not have android.jar, project.properties, ...
How can I use them as Android Project?

This is an android-maven project.
I think there are two ways:
First
You'll need to download MAVEN and Install it.
Once completed, go to the command line. Check that maven is working by typing..
mvn --version
Once you get it working, with the command line, navigate to the project directory (where the pom.xml file is located) and type..
mvn clean install
This should generate the necessary files.
Second
Download the m2eclipse (Maven to Eclipse) eclipse plugin.
Once installed, go to:
File -> Import -> Maven -> Existing Maven Projects -> Choose the project folder
If you're using Android Studio, there is also an option available to import maven projects.
Personally, I prefer the first method... but it's up to you :)

2 options:
Ask them to Create a new project from existing source.
Push your .project file to github, and eclipse should be able to setup the android project correctly.

Related

IntelliJ - maven project, View/Tool Windows without maven option

I use IntelliJ IDEA Community 2020.1. I have generated a maven project structure from the command line using a custom archetype. I open that project in IntelliJ this way: File/New/Project from Existing Sources/Create project from existing source. A project is opened but I don't see a maven option in View/Tool Windows. I would like to run mvn install from IDE. What I'm doing wrong ?
You need to add the Maven support for the project that you have created.
Simply right-click on the project --> Add Framework Support --> Choose maven from the option.
For detail, you can follow the steps mentioned here Add maven support.

Checking out SVN gradle project directly into eclipse?

Let's say I have a few java projects on an SVN repository. If I want to check them out in an eclipse workspace at the moment, I first need to check out the projects in the workspace, then import them as gradle projects using Eclipse Buildship.
If I try to check them out using the new project wizard, it seems to just initialize another gradle project on top of what's already there, leaving me without the files I was trying to check out in the first place. What I would like is to be able to directly check these out as gradle projects, in a one-step process as opposed to checking them out and then re-importing them into my workspace. Is this possible? If so, what plug-ins or gradle build configurations are necessary to achieve it?
Right-click on your project at Project Explorer -> Configure -> Add Gradle Nature should change your project's configuration to a Gradle project without creating any configuration file.

Converting SVN project to maven project in Eclipse

I have downloaded a project (Maven based structure) from our SVN repository using Eclipse SVN plugin. Initially, Eclipse wasn't recognizing it as java project so I had to follow the following steps:
http://www.javaexperience.com/how-to-convert-svn-project-to-regular-eclipse-java-project/
The above steps worked well and the project was converted to java project.
Next I right clicked on the project and selected maven->Convert to maven project. Eclipse downloaded some jars and added it to the class path but not all files seem to have been downloaded successfully as I see Junit jar file missing error (where as junit is mentioned in pom.xml)
When I right click on the pom.xml file, I don't see the option "mvn install" or "mvn clean". I am using Eclipse Kepler which comes with maven plugin out of the box.
You will find the Maven commands in 'Run As', not in 'Maven'
I would first create a maven project using create maven project menu then add the SVN based source code to it.

What do I do with the pom.xml file?

I have just downloaded a project from github, it has a pom.xml and is missing many dependencies.
I installed m2e Maven integration in Eclipse plugin but now what do I do? It's installed and seems to be working but how do I download the dependencies now?
You checkout the git files to a location different from your Eclipse workspace.
Start Eclipse on a clean workspace and install m2e. (I usually install m2e-wtp to get web projects)
Use File -> Import -> Existing Maven projects.
Point to the pom.xml you want to use in the files checked out above.
Wait while Eclipse downloads half the Internet.
Ready.
Right click on your project, run as -> maven install.
If you can't see these, you either incorrectly installed m2e, or you need to import the project as a maven project.
In that case, delete the project from your workspace (do not check the "delete contents on disk"). Right click in the project explorer and click on import... From that dialog, you can select existing maven projects, where you need to navigate to the highest directory containing a pom.xml file.
Also, if you have maven installed on your computer (not m2e in eclipse), you can open the directory that contains the pom.xml and just type mvn clean install. This will build your project.
If you get a "Build success" message, you'll know that the dependencies have been fetched correctly.
In eclipse, You have to convert your project to a maven project. right click on your project -> maven (or configure) -> convert to maven project (or enable dependencies management).
This should update your dependencies automatically, if it is not the case then right click your project -> maven -> update project (or update dependencies, it depends on the verion of m2e you are using).
It should be enough to build the project. The dependencies should be downloaded during the build.
Pom.xml files are used for Maven projects.
Depending on your Eclipse version, maybe it's not compatible with Maven out of the box. If not, you can install a Maven plugin (like m2e) so that the project can be viewed as a Maven project.
Maven will do the dependency management (if pom.xml file is configured properly)
When you right click on your project->Run As-> Maven install it will download all the dependencies that it does not have already in your local repository.

How to run a downloaded Java and Maven Project

I'm new in Maven,Java and Eclipse. I just download a project that uses Maven. I want to know how can import and run this project by Eclipse. I install m2eclipse and work with it but i don't know how can I import a existing project.
You need a maven plugin for Eclipse. m2eclipse or Apache Maven Plugin
This links will help you to import the project. M2eclipse Guideline and Importing maven project into eclipse
Use the Maven Eclipse Plugin. It generates the necessary files for the Eclipse IDE.
For running maven project you will need to install maven plugin in eclipse and than right click on it and select run as maven install
Here is an alternate way without using m2Eclipse plugin.
Install Maven and add the bat file to the path. Once this is done open a command prompt and go to the directory where the pom.xml file of your project exists. At this directory level do a:
mvn eclipse:eclipse
This will make your project Eclipse friendly. Once this is completed, import the project by using File Menu in Eclipse. File->Import. In dialog select Existng Projects into Workspace. Click Next. Then select the root directory as the directory from which you ran the mvn command. Click Finish.
You project should now be in your Eclipse IDE

Categories

Resources