3

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 ?

Dante
  • 10,722
  • 16
  • 51
  • 63
  • Very similar to a question I asked a couple of years ago when I was learning Maven: http://stackoverflow.com/questions/2511908/how-can-i-make-one-maven-module-depend-on-another – Daniel Pryden Sep 16 '12 at 04:36

2 Answers2

5

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>
Morteza Adi
  • 2,413
  • 2
  • 22
  • 37
1

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.

basiljames
  • 4,777
  • 4
  • 24
  • 41