Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

idea intellij maven project can't make

I have maven project. Maven build complete SUCCESS. But i can't make this project.

[INFO] BUILD SUCCESS

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/iNaWO9gy http://screencast.com/t/iBGTyMpgH

Project settings - Libraries - empty;

reimport didn't help;

like image 541
yazabara Avatar asked Apr 09 '14 07:04

yazabara


People also ask

How do I create a project Maven project in IntelliJ?

In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.

Why Maven is not working in IntelliJ?

Maven dependencies imported incorrectly If the dependencies weren't imported correctly (IntelliJ IDEA highlights them), try to perform the following actions: You can check your local maven repository in the Maven | Repositories settings and try to update it. You can check the jar file of the local .

Can we create Maven project in IntelliJ?

You can easily create a new Maven project, open and sync an existing one, add a Maven support to any existing IntelliJ IDEA project, configure and manage a multi-module project. You can also create a Maven project and store it in the WSL environment or open it from the WSL file system.


Video Answer


1 Answers

Do the following steps:

  1. Find your pom.xml in your files
  2. Right click on it --> Maven --> Import
  3. Wait for the project to load :D
  4. Press ctrl+alt+shift+s (This opens the Projects window.)
  5. Go to libraries and see if they are empty (they shouldnt)
  6. If they are post your full pom.xml please so I can see the problem
  7. If you still have a problem got to File --> Invalidate Caches /Restart
  8. Go to maven and Reimport All Maven Projects
like image 192
zpontikas Avatar answered Sep 17 '22 14:09

zpontikas