I have a project on Bitbucket. Only the sources are committed. To retrieve the project onto a new machine, I used Version Control > Checkout from Version Control from within IntelliJ.
It then asks whether I would like to create a new project from this source, to which I reply Yes. So far, so good. It creates a nice little Java project for me, consisting of a single module.
However, my goal in pulling this project into IntelliJ was to turn it into a Maven project. I cannot find any option anywhere that will let me do this!
Is there a way to have IntelliJ just generate a basic empty pom.xml for me, with a name and an artifactId and a repository? Or, is there a way to import the project as a Maven project in the first place? (Whenever I try to create a project from existing source, it only gives me the option of a Java project.)
In the Project tool window, right-click the project folder and select New | Module. Alternatively, from the main menu, select File| New | Module to open the New Module wizard. If you used main menu to add a module then the process of adding a module is the same as Creating a new Maven project.
Right-click on the module, select "Add framework support...", and check the "Maven" technology.
(This also creates a pom.xml
for you to modify.)
If you mean adding source repository elements, I think you need to do that manually–not sure.
Pre-IntelliJ 13 this won't convert the project to the Maven Standard Directory Layout, 13+ it will.
A visual for those that benefit from it.
After right-clicking the project name ("test" in this example), select "Add framework support" and check the "Maven" option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With