Java 我在哪里可以在不使用 Maven 的情况下下载 Spring Framework jars?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19082860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 13:56:28  来源:igfitidea点击:

Where can I download Spring Framework jars without using Maven?

javaspringspring-mvc

提问by java_dude

SpringSource.org changed their site to http://spring.io

SpringSource.org 将他们的站点更改为http://spring.io

Does someone know how to get the latest build without Maven/github? from http://spring.io/projects

有人知道如何在没有 Maven/github 的情况下获得最新版本吗?来自http://spring.io/projects

采纳答案by fujy

Please edit to keep this list of mirrors current

请编辑以保持此镜像列表为最新

I found this mavenrepo where you could download from directly a zipfile containing all the jars you need.

我找到了这个mavenrepo,您​​可以在其中直接从zip包含您需要的所有 jar的文件下载。

Alternate solution: Maven

替代解决方案:Maven

The solution I prefer is using Maven, it is easy and you don't have to download each jaralone. You can do it with the following steps:

我更喜欢的解决方案是使用Maven,它很简单,您不必jar单独下载。您可以通过以下步骤来完成:

  1. Create an empty folder anywhere with any name you prefer, for example spring-source
  2. Create a new file named pom.xml
  3. Copy the xml below into this file
  4. Open the spring-sourcefolder in your console
  5. Run mvn install
  6. After download finished, you'll find spring jars in /spring-source/target/dependencies

    <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>spring-source-download</groupId>
      <artifactId>SpringDependencies</artifactId>
      <version>1.0</version>
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>3.2.4.RELEASE</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>download-dependencies</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
    
  1. 例如,使用您喜欢的任何名称在任何地方创建一个空文件夹 spring-source
  2. 创建一个名为的新文件 pom.xml
  3. 将下面的xml复制到这个文件中
  4. spring-source在控制台中打开文件夹
  5. mvn install
  6. 下载完成后,你会在 /spring-source/target/dependencies

    <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>spring-source-download</groupId>
      <artifactId>SpringDependencies</artifactId>
      <version>1.0</version>
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>3.2.4.RELEASE</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.8</version>
            <executions>
              <execution>
                <id>download-dependencies</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/dependencies</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
    


Also, if you need to download any other spring project, just copy the dependencyconfiguration from its corresponding web page.

另外,如果您需要下载任何其他 spring 项目,只需dependency从其相应的网页中复制配置即可。

For example, if you want to download Spring Web Flowjars, go to its web page, and add its dependencyconfiguration to the pom.xmldependencies, then run mvn installagain.

比如你要下载Spring Web Flowjar包,去它的网页,将它的dependency配置添加到 中pom.xmldependencies,然后mvn install再次运行。

<dependency>
  <groupId>org.springframework.webflow</groupId>
  <artifactId>spring-webflow</artifactId>
  <version>2.3.2.RELEASE</version>
</dependency>