Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - package org.springframework.stereotype does not exist

I'm just starting to use IntelliJ and working on making a very simple "hello world" application. It looks like a very simple setup issue but I can't find a solution here that works.

Here's the pom.xml

<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>com.jay.jayWorld</groupId>
  <artifactId>simple-project</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>simple-project</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${springframework.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>javax.servlet.jsp-api</artifactId>
      <version>2.3.1</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
          <configuration>
            <source>1.6</source>
            <target>1.6</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <finalName>Spring4MVCHelloWorldDemo</finalName>
  </build>
</project>

Is it because I'm using ${springframework.version}? I've seen from some project that this works but not to be the case in my project. Do i need to define it somewhere?

Here's the screenshot of the error. enter image description here

like image 928
JAY Avatar asked Nov 25 '25 22:11

JAY


1 Answers

You need to define a property named springframework.version in your maven POM. Like this

<properties>
    <springframework.version>4.3.11</springframework.version>
</properties>
like image 199
mrkernelpanic Avatar answered Nov 27 '25 11:11

mrkernelpanic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!