• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Basic Question

 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick Question:

Using Maven, how do you set up a common project that can serve as a repo for Maven to access needed jar files?

Do you just create another project to hold the common jar files and then "include" that project in your main development project?

Or is this practice even advised?

Thanks in advance.

Mike
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possibility is to create a "pom" project - that is a projects of type pom that contains a list of dependencies. Then for your other projects, reference that pom project as a dependency; then Maven will pull in all the the JARs defined in the pom project.

Alternately, make that pom project the parent for your projects. Then the JARs will also be included. In our work environment, we have defined multiple parent pom projects, each for a different project type, and then the child projects inherit that configuration. This ensures that all projects of type X are built exactly the same way.
 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:One possibility is to create a "pom" project - that is a projects of type pom that contains a list of dependencies. Then for your other projects, reference that pom project as a dependency; then Maven will pull in all the the JARs defined in the pom project.

Alternately, make that pom project the parent for your projects. Then the JARs will also be included. In our work environment, we have defined multiple parent pom projects, each for a different project type, and then the child projects inherit that configuration. This ensures that all projects of type X are built exactly the same way.


Cool, thanks for your reply.

We're using Intellij as our IDE.

Can both of these options be easily done using it?

Maven still seems like a confusing haze at the moment.

Thanks,

- m
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your IDE, create a separate Maven Project for the parent POM. That project will have only one file in it - the pom.xml file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic