Import a maven project into netbeans - java

I'm learning how to create some applications in Java, i found a maven project example in a tutorial and went to compile it in netbeans.
I tried to search in the Internet how to import a maven project into netbeans, and i can't found a solution.
By the way, in the tutorial i downloaded something like pom.xml, i wonder what is it and how it can be used?
Thanks!

You can import Eclipse Maven project in netbean, just follow the steps.
1) In Netbean , File->New Project->Select maven in left Pane -> Select Project with existing POM on right pane and finish.
2) Now you will be asked to open a eclipse project just open it and that's it..
I hope you will solve your problem with this......

Although not really a direct solution to your problem, a work around to get you up and running is to create a maven project in Netbeans via the wizard, with the same name as the example project you want to install. Then, create the same package structure in the project as the example, then copy the files into their correct packages. Although you are not importing the project, but it should get you up and running.

Related

Why I can't build path for a project that was cloned from Github in Eclipse?

I cloned a project of my teams from Github using a link to my Folder Java. I only used the Clone tools in Eclipse and added it to my Package Explorer as a General Project. But when I open the project, all the package became normal folder, I click into the folder to the Build Path but there's nothing I can't do. I don't understand why, please help me!
If it's a Maven project using the smart import might help.

Spring-Boot application does not build properly

my problem is when I trying to run my spring-boot project via STS or simple JavaApplication the changes after the last maven build are not built.
I'm tried several methods but, if I don't use maven build the project changes are not rebuilt.
Do you have any tips, what's wrong?
In the Project menu Build Automatically is selected. And the main method is annotated with #SpringBootApplication
(The hot-swap is not working too for me.)
I think . do clean first then right click project Maven-> update Maven. do clean again. plz
I found the solution. In the .project file for my project I simply added a javabuilder build command. After that STS works perfectly and rebuilds the project before start. I think this problem occurs because I created a maven project, instead of creating a java project and convert it to a maven project.
If your project is gradle then go to Project right click and go to >gradle >Refresh gradle project.
Try to click ctrl +shift+O for import realated dependencies in your project.

Java project issue in import

I am very new to java.
I downloaded Netbeans 8.2 and Jdk 1.8 and installed both.
And opened one of the projects where I'm getting three import statement issue.
import org.apache.commons.fileupload;
import org.apache.commons.fileupload.disk.diskfileitrmfactory;
import org.apache.commons.fileupload.servlet.servletfileupload;
I have my got the below jar in web-inf/lib path in project
Commons-fileupload-1.2.2.jar
Commons-up-2.4.jar
Please guide me to get the project compiled. I am clueless since I have no idea about java and trying to run the project and debug .
Import your jar files the proper way.
Right click your project >
Properties >
Libraries
Then click the Add Jar/Folder button to import the jars you need.
After this, clean and build the project (Right click > Clean and Build), and try to run it.
Your setup probably has some sort of error to find out the path to those .jar files, it is common to happen when you've got the files imported in a wrong way.
I'd like to suggest to you to use Maven. Maven is a dependency manager and will be in charge to manage all your dependencies along the build of your project among all other features. It is easy to use and will make your life a lot easier.
Here you have two links, one if you'd like to understand better how it works (https://maven.apache.org/guides/getting-started/) and the another to help you to build your Maven project (https://maven.apache.org/guides/getting-started/). I don't use NetBeans IDE but it probably has support for Maven, but in case it doesn't, you could look for a plugin.
Hope it helps.

Importing a Java project to IntelliJ IDEA community edition

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.

Source folders for a maven project in eclipse

I have a that uses maven... and I want to put it in my working environment with eclipse(Galileo)... the project is in a svn server, and I can create check out the project and everything looks OK. I even can run the unit test and everything is working there.
However, now that everything is there I wanted to work in the code, and oh surprise there are no packages in my project... I mean all the source code is in the src folder and browsing through it i can see all my files, ut if I open the files from there, the files are opened as text files with no coloring, but worst no help at all about errors in compilation.
I don't know what im I doing wrong now, because I had the same project in other machine and it was working well.
So here is what I did, please let me know if you notice if I did something wrong, miss any steps or anything that can help me:
In the SVN Repository (Using subclipse 1.6.10) I added my SVN Repository
Browsed to the folder where I have the pom file
Right Click> Check out as a Maven project...(Using m2eclipse 0.10.020100209)
Used the default options and finish.
The projects were created with no problem. I said projects because this maven project has modules, and each module became a project in eclipse.
Back in the java perspective, Right click in the project, Run as > maven test(Using JWebUnitTest, because I am testing a servlet)
BUILD SUCCESS!!
But as I said there is not packages so I can't really develop in this environment.
Any help??
Thanks!
When performing a svn checkout as maven project, m2eclipse writes what it does in a console window, accessible using the "console" panel, where there is a drop-down list of all available consoles. What does this console tells ?
Besides, if you can perform a maven test, you can also, in the maven menu (of your contextual menu) do a "update project configuration" which should do the same thing and configure eclipse for your project.
As a last test, is there a maven icon over your project ?
Have you tested your setup on command line with Maven ? Does a mvn package work without errors ? The location for the sources in Maven is src/main/java + Package name. Have you opened the project as a Maven project?
Thanks for your help, however I noticed that eclipse itself was behaving weird when I try to create a package there and I didn't have the option.
So I found out that for some reason that eclipse installation wasn't giving me any of the Java basic options.
So I download a new eclipse installation.. and I repeat the whole process and now is working...
No clue what was the problem with this eclipse because I was using it for other projects and I don't know when I lost the basic functionalities!
Thanks anyway!

Categories