aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Basic Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Basic Question" Watch "Maven Basic Question" New topic
Author

Maven Basic Question

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1066
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

Joined: May 14, 2008
Posts: 5830
    
    7

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.

JBoss In Action
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1066
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

Joined: May 14, 2008
Posts: 5830
    
    7

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Maven Basic Question