繁体   English   中英

如何从 maven 的本地存储库中找出我可以使用哪些依赖项?

[英]How to find out what kind of dependencies I can use from local repository in maven?

所以我在第一个项目中运行了mvn clean install ,我在我的本地 maven 存储库中找到了它。 但是我怎么知道在项目两个pom.xml中输入什么来使用我刚刚安装到我的 maven 存储库的 jar?

我需要以下内容,但需要使用我安装的项目值:

<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>5.3.4</version>
</dependency>

如何找出如何将我的第一个项目依赖项拉入我的第二个项目?

在第二个项目的pom.xml中,输入这个内部dependencies项标签。 所以应该是这样的

<dependencies>
    <dependency>
        <groupId>group id of first Project</groupId>
        <artifactId>Artifact id of first project</artifactId>
        <version>version of the first project</version>
    </dependency>
        <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
         <version>5.3.4</version>
    </dependency>
 <dependencies>

您可以从第一个项目的pom.xml中找到所有这些信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM