简体   繁体   English

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

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

So I ran mvn clean install in first project, I find it in my local maven repository.所以我在第一个项目中运行了mvn clean install ,我在我的本地 maven 存储库中找到了它。 But how am I supposed to know what to type in project two pom.xml to use the jar I just installed to my maven repository?但是我怎么知道在项目两个pom.xml中输入什么来使用我刚刚安装到我的 maven 存储库的 jar?

I need the following but with my installed project values:我需要以下内容,但需要使用我安装的项目值:

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

How to find out how to pull my first project dependency into my second project?如何找出如何将我的第一个项目依赖项拉入我的第二个项目?

In your pom.xml of the second project enter this inside dependencies tag.在第二个项目的pom.xml中,输入这个内部dependencies项标签。 so it should be something like this,所以应该是这样的

<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>

you can find all those information from pom.xml of the first project您可以从第一个项目的pom.xml中找到所有这些信息

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

相关问题 如何从 gradle 中的 maven 本地存储库安装依赖项? - how to install dependencies from maven local repository in gradle? Maven-如何使用本地存储库 - maven - how to use local repository 如何仅从pom.xml而不是从Maven本身将Maven依赖项下载到本地存储库中 - How to download Maven dependencies into a local repository, only from pom.xml, not from Maven itself 我如何创建对象类以执行从Maven存储库下载.jar依赖项 - How can i create an object class to perform downloading of .jar dependencies from maven repository 如何将依赖项从本地存储库复制到某个特定位置? - How can I copy dependencies from the local repository to some specific location? 为什么我不能从本地存储库导入 maven jar? - why i can't import maven jar from local repository? 如何在Local Maven存储库中使用gradle jar - How to use in gradle a jar from the Local Maven repository 当我从 Maven 向项目添加 lib 时。 如何找出我可以使用的课程? - When I add a lib to a project from maven. How do I find out classes I can use? 如何阻止 Maven 自动更新其本地存储库? - How can I stop Maven from automatically updating its local repository? 如何强制 IntelliJ 在失去依赖关系时读取本地 maven 存储库或从 web 下载? - how to force IntelliJ to read local maven repository or download from web when it loses track of dependencies?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM