简体   繁体   English

Maven项目结构损坏

[英]Maven project structure corrupted

I am building a Java Web Project (JAX-RS). 我正在构建一个Java Web项目(JAX-RS)。 Initially the project had the right structure. 最初,该项目具有正确的结构。 However after doing a maven clean and maven update the structure of the project seems to be corrupted in Eclipse. 但是,在执行了maven清理和maven更新后,项目的结构似乎在Eclipse中已损坏。

Initially the layout was as follows: 最初的布局如下:

-Root
    --src/main/java
    --src/test/java
    --..

After the clean-up the layout appears as: 清理后,布局显示为:

-Root
    --src
        --main.java.com..<package1>
        --main.java.com..<package2>
        --...
    --src/test/java
    --..

Also now the whole project no longer builds. 现在整个项目也不再构建。 Any ideas as to how this can be fixed ? 关于如何解决此问题的任何想法?

Eclipse sometimes behave oddly. Eclipse有时表现得很奇怪。 I have found recreating the project from scratch is the best way when encountered a scenario like this. 我发现从头开始重新创建项目是遇到这种情况的最佳方法。

To create project from scratch. 从头开始创建项目。 Use maven archtype . 使用maven archtype Follow the link here . 请点击此处的链接。

Then copy your current sources over to the newly created projects. 然后将当前资源复制到新创建的项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM