本文介绍了想法intellij maven项目无法做到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有maven项目。 Maven构建完整的SUCCESS。但我不能做这个项目。
I have maven project. Maven build complete SUCCESS. But i can't make this project.
[INFO]建立成功
[INFO] BUILD SUCCESS
项目包含一个模块。 Idea无法看到依赖项。
Project contains one module. Idea can't see dependencies.
Error:(3, 38) java: D:\Dropbox\Programming\java\spring\springBook\src\main\java\ch14\validator\ContactTestValidator.java:3:
package org.springframework.stereotype does not exist
POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>springBook</groupId>
<artifactId>springBook</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- Shared version number properties -->
<properties>
<org.springframework.version>3.2.3.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<!--для валидации бинов необходима-->
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<!--Spring Data JPA использует его - добавим и пользуемся-->
<!--API для работы с датами-->
<!--ch14 validator-->
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<!--ch14 validator-->
<!--API интерфейса JSR-303-->
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<!--ch14 validator-->
<!--API, которая поддерживает интерфейс JSR-303 - BeanValidation-->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
</dependency>
<dependency>
<!--для валидации. (@Type...)-->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
</dependency>
<!--Spring framework-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
<build>
<finalName>springBook</finalName>
</build>
</project>
你能帮助我吗?不幸的是,我无法添加截图..
有截图:
Could you help me? Unfortunately, I can't add screenshots..There are screenshots:http://screencast.com/t/iNaWO9gyhttp://screencast.com/t/iBGTyMpgH
项目设置 - 图书馆 - 空;
Project settings - Libraries - empty;
重新导入没有帮助;
推荐答案
好听。
执行以下步骤:
- 在文件中找到你的pom.xml
- 右键单击它 - > Maven - > Import
- 等待项目加载:D
- 按 + + + (这将打开项目窗口。)
- 转到库并查看它们是否为空(它们不应该)
- 如果他们发布了您的完整pom.xml,那么我可以看到问题
- 如果您仍有问题需要File - > Invalidate Cache s
/重启 - 转到maven并重新进口所有Maven项目
- Find your pom.xml in your files
- Right click on it --> Maven --> Import
- Wait for the project to load :D
- Press +++ (This opens the Projects window.)
- Go to libraries and see if they are empty (they shouldnt)
- If they are post your full pom.xml please so I can see the problem
- If you still have a problem got to File --> Invalidate Caches/Restart
- Go to maven and Reimport All Maven Projects
这篇关于想法intellij maven项目无法做到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!