eclipse - 使用 Maven 将 JAR 文件添加到 Eclipse 中的项目

标签 eclipse maven

我正在尝试添加使用 Maven 的项目所需的与 Spring 框架相关的某些 JAR 文件。

项目名称:Spring

Project Name: Spring

是否可以使用 Maven 来完成此操作?

依赖关系如下:

<!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aspects</artifactId>
    <version>3.2.7.RELEASE</version>
</dependency>

最佳答案

您应该将项目导入为 Maven 项目。如果它不是 Maven 项目,您可以使用 Eclipse转换它。

然后您应该将您的依赖项作为项目的 pom.xml 中的依赖项之一,如下所示:

<dependencies>
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>3.2.7.RELEASE</version>
    </dependency>
</dependencies>

关于eclipse - 使用 Maven 将 JAR 文件添加到 Eclipse 中的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50149927/

相关文章:

java - 具有依赖项的 Keycloak 扩展

java - eclipse 中的刷新和更新项目有什么区别

android - 为什么我无法构建 Android 源代码?

linux - 在远程 linux 服务器的 tomcat 中部署 eclipse maven 项目

maven - 使用 Maven Cargo 插件将 Web 应用程序部署到外部 glassfish4 实例

java - 如何更改 Vaadin 中的默认 HTML 模板

android - Gradle 忽略传递依赖(而且我没有使用仅 Artifact 表示法)

eclipse - 在Eclipse中编辑代码时如何禁用粗体字体?

java - 将 JFXtras 添加到我的项目中

java - 将 ZbarScanner 与安卓应用集成