无法在 IntelliJ 中通过 Maven 导入 spring 3.0.6 jar

发布于 2024-12-07 14:42:30 字数 6489 浏览 1 评论 0 原文

问题

我正在尝试在 IntelliJ 中获取准系统 spring mvc 项目(类似于 STS 中提供的模板),但 spring 3.0.6 jar 未导入。即使我完成后也没有:右键单击项目名称 - > Maven - >强制重新导入

我尝试过的内容

  1. 阅读以下文章http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/

  2. 在我的pom中添加了所有spring jar依赖项.xml

  3. 将属性块放在依赖项外部,版本为 3.0.6
  4. 添加了以下存储库条目(抱歉,不确定如何在此处输入 xml): http://maven.springframework.org/snapshot http://maven.springframework.org/milestone http://repo1.maven.org/maven2
  5. 右键单击​​项目->Maven->强制重新导入
  6. 没有任何效果。

有人知道为什么吗?

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>springplusjasper</groupId>
<artifactId>springplusjasper</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>springplusjasper Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- Shared version number properties -->
<properties>
    <org.springframework.version>3.0.6.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.springframework</groupId>
        <artifactId>org.springframework.core</artifactId>
        <version>3.0.6.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.expression</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.beans</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.aop</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context.support</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.transaction</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.jdbc</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.orm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.oxm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.servlet</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.portlet</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.test</artifactId>
        <version>${org.springframework.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<repositories>
<repository>
  <releases>
    <enabled>false</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
  <id>org.springframework.maven.snapshot</id>
  <name>Spring Maven Snapshot Repository</name>
  <url>http://maven.springframework.org/snapshot</url>
</repository>
<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>org.springframework.maven.milestone</id>
  <name>Spring Maven Milestone Repository</name>
  <url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>central</id>
  <name>Maven Repository Switchboard</name>
  <url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<build>
    <finalName>springplusjasper</finalName>
</build>
</project>

Problem

I am trying to get a barebones spring mvc project (similar to the template provided in STS) in IntelliJ but the spring 3.0.6 jars do not get imported. Not even after I have done: Right Click on Project Name->Maven->Force Reimport

What I have tried

  1. Read the following post http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/

  2. Added all the spring jar dependencies in my pom.xml

  3. Put a properties block outside dependencies with 3.0.6 as the version
  4. Added the following repository entries (sorry not sure how to enter xml here):
    http://maven.springframework.org/snapshot
    http://maven.springframework.org/milestone
    http://repo1.maven.org/maven2
  5. Right click on the project->Maven->Force Reimports
  6. Nothing comes down.

Anybody know why?

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>springplusjasper</groupId>
<artifactId>springplusjasper</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>springplusjasper Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- Shared version number properties -->
<properties>
    <org.springframework.version>3.0.6.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.springframework</groupId>
        <artifactId>org.springframework.core</artifactId>
        <version>3.0.6.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.expression</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.beans</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.aop</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.context.support</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.transaction</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.jdbc</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.orm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.oxm</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.servlet</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.portlet</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.test</artifactId>
        <version>${org.springframework.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<repositories>
<repository>
  <releases>
    <enabled>false</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
  <id>org.springframework.maven.snapshot</id>
  <name>Spring Maven Snapshot Repository</name>
  <url>http://maven.springframework.org/snapshot</url>
</repository>
<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>org.springframework.maven.milestone</id>
  <name>Spring Maven Milestone Repository</name>
  <url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>central</id>
  <name>Maven Repository Switchboard</name>
  <url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<build>
    <finalName>springplusjasper</finalName>
</build>
</project>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守不住的情 2024-12-14 14:42:30

spring 的工件 id 是 spring-core、spring-beans 等。

Artifact ids for spring are spring-core, spring-beans etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文