简体   繁体   English

无法加载项目(Netbeans IDE)

[英]Project cannot be loaded (Netbeans IDE)

I downloaded the archive with the project, and unpacked it.我下载了项目的存档,并解压缩了它。 I threw it in the project folder, but when I open it through Netbeans IDE - I get an error (Project cannot be loaded) and missing package with codes It is strange that on another computer it opens a project without problems Some problems were encountered while processing the POMs:我把它扔到项目文件夹中,但是当我通过 Netbeans IDE 打开它时 - 我得到一个错误(无法加载项目)并且缺少 package 代码 奇怪的是在另一台计算机上它打开一个项目没有问题处理 POM:

[ERROR] 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter:jar is missing. @ line 22, column 21
[ERROR] 'dependencies.dependency.version' for org.projectlombok:lombok:jar is missing. @ line 33, column 21
[ERROR] 'dependencies.dependency.version' for org.apache.logging.log4j:log4j-api:jar is missing. @ line 39, column 21
[ERROR] 'dependencies.dependency.version' for org.apache.logging.log4j:log4j-core:jar is missing. @ line 43, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-core:jar is missing. @ line 54, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-aspects:jar is missing. @ line 58, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-context:jar is missing. @ line 62, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-web:jar is missing. @ line 66, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-webmvc:jar is missing. @ line 70, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-orm:jar is missing. @ line 74, column 21
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-tx:jar is missing. @ line 78, column 21

It seems, that the project, you've copied, references another project.您复制的项目似乎引用了另一个项目。 If you open pom.xml there probably is a section "parent" there, where a parent project is defined:如果你打开 pom.xml 那里可能有一个“父”部分,其中定义了一个父项目:

<!-- Identifier of the parent project -->
<parent>
    <groupId>...group of your parent project...</groupId>
    <artifactId>... artefactId of your parent project ...</artifactId>
    <version>... version of your parent project ...</version>
</parent

This parent project probably contains dependencies with versions.这个父项目可能包含与版本的依赖关系。 Child module, you've copied, contains dependencies without versions:您复制的子模块包含没有版本的依赖项:

<!-- Version of the dependency is defined in parent pom in dependencyManagement section -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <!-- here should be the version -->
</dependency>

You either need to copy the parent project on your computer as well or set all the dependencies versions manually.您还需要在您的计算机上复制父项目或手动设置所有依赖项版本。

This is a Spring Boot project.这是一个 Spring 引导项目。 To have it displayed correctly in Netbeans:要使其在 Netbeans 中正确显示:

  • Open the project in Netbeans在Netbeans打开项目

  • Add Maven Central to your list of repositories 将 Maven Central 添加到您的存储库列表

  • Right click on the project and run Build.右键单击该项目并运行 Build。

  • During the build the artifact spring-boot-starter-parent is downloaded to your local maven repository and now Netbeans can display the project correctly.在构建期间,工件spring-boot-starter-parent被下载到您的本地 maven 存储库,现在 Netbeans 可以正确显示项目。

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

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