本文介绍了IntelliJ - 将Java项目/模块转换为Maven项目/模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于Bitbucket的项目。只提交了来源。为了将项目检索到新机器上,我在IntelliJ中使用了Version Control> Checkout from Version Control。

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.

然后询问我是否要从中创建一个新项目这个来源,我回复是的。到现在为止还挺好。它为我创建了一个不错的小Java项目,由一个模块组成。

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.

然而,我将这个项目拉入IntelliJ的目标是将其转变为Maven项目。我找不到任何可以让我这样做的选项!

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!

有没有办法让IntelliJ为我生成一个基本的空pom.xml,名字和artifactId和存储库?或者,有没有办法将项目作为Maven项目导入? (每当我尝试从现有源创建项目时,它只给我一个Java项目的选项。)

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.)

推荐答案

对 - 点击模块,选择添加框架支持...,然后选中Maven技术。

Right-click on the module, select "Add framework support...", and check the "Maven" technology.

(这也会创建一个 pom.xml 供您修改。)

(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.

预IntelliJ 13这不会将项目转换为,13+它将会。

Pre-IntelliJ 13 this won't convert the project to the Maven Standard Directory Layout, 13+ it will.

这篇关于IntelliJ - 将Java项目/模块转换为Maven项目/模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 15:43