Dante
Dante

Reputation: 11264

How to reference one maven project from another maven project?

I have an in-development library project (module by IntelliJ definition) that i want to reference from other projects. How would i go about to reference that project in other projects ?

Upvotes: 3

Views: 17352

Answers (2)

Morteza Adi
Morteza Adi

Reputation: 2473

you can use whether Dependency or module tags in pom.xml of your project. Depends on what you trying to do.

<dependency>
        <groupId>com.mysubpro</groupId>
        <artifactId>myproject</artifactId>
        <version>1.0-SNAPSHOT</version>
</dependency>  

Or

<modules>
    <module>myproject</module>
</modules>

Upvotes: 5

basiljames
basiljames

Reputation: 4847

You have to use mvn install goal. This will install your library to your local repository. Link to Maven Install Plugin. Once it is done you can have a dependency to it in your other projects.

Upvotes: 1

Related Questions