java导入文件不显示,导入的maven项目不会显示为java项目。显示文件夹

I checked out the existing project source code from SVN to a folder in my system.

Then I opened eclipse. Import Project-> Existing Maven Project.

It imported without issues. However, Project Explorer shows it as just folders instead of packages. (Like when we create a package and then add classes to it, it shows a different icon for package root). I opened Navigator and Package Explorer as well. But they are showing them as folders as well.

I tried:

mvn eclipse:clean

mvn eclipse:eclipse

on the root of the project. But it did not help.

Can anyone help on this one?

My folder structure:

ecs->

ecs-ejb->

src/java/main/com/xxx

pom.xml

ecs->ear->

src/java/main/com/xxx

pom.xml

pom.xml

解决方案

Try to:

Right click the project->Configure->Convert to Maven Project

---- Edit ----

If this doesnt work, it is likely that someone checked in their environment files into your SVN. If they checked in:

.project

.classpath

.settings/

They could be conflicting with your environment (different settings/plugins/versions of eclipse...). Try dropping your project, deleting the folder/files, then remove these files from SVN, and repeat your initial process. All of these files/folders will get generated during the import to eclipse.

---- Edit 2 ----

Per your recent edit to the question, you have a multi-module project. If you only did this on the parent project, then there is no source folder. So you wouldn't see it. You should:

File->Import...

Choose Existing Maven Projects, Next

Set the Root Directory to ecs/ecs-ejb, Finish

Repeat for all other modules.

In eclipse, each module of a multi-module maven project needs its own eclipse project.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值