stacktrace2234
stacktrace2234

Reputation: 1500

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

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?

Upvotes: 0

Views: 28

Answers (1)

Sam
Sam

Reputation: 4284

In your pom.xml of the second project enter this inside dependencies tag . 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

Upvotes: 1

Related Questions