The folder is already a source folder;maven web 创建source folder 不能创建的有关问题

The folder is already a source folder;maven web 创建source folder 不能创建的问题

转自:http://www.java123.net/v/985931.html

 

maven web项目不能创建src/main/java等文件夹的问题

eclipse 创建maevn web项目,在选择maven_archetype_web原型后,默认只有src/main/resources这个Source Floder。 按照maven目录结构,添加src/main/java、src/test/java等Source Floder时,会报目The folder is already a

    eclipse创建maevn web项目,在选择maven_archetype_web原型后,默认只有src/main/resources这个Source Floder。

    按照maven目录结构,添加src/main/java、src/test/java等Source Floder时,会报目The folder is already a source folder的错误。

    解决办法:用Navigator视图,直接在src/main目录下建立java目录。

    分析原因: 项目属性->Java Build Path->Source,会看到src/main/java, src/test/java已存在,但是Missing。所以只需要创建目录,Source Floder就出现了。