Fetch Maven dependencies

I have an IDEA project with maven modules with external dependencies.  How can I configure TeamCity to automatically fetch the external dependencies before building IDEA artifacts?  I can't find any options in the IDEA or Maven build step types.

4 comments
Comment actions Permalink

Jayen,

You can fetch external dependencies using Maven build step with goal dependency:resolve

Add this step before idea runner and dependencies will be resolved before building idea artifacts

0
Comment actions Permalink

Thanks, that was very helpful.  My next problem is that we have a pom.xml for each module.  Some modules depend on each other, and there is more than one not-dependency module.  (I'm totally new to Maven and at the moment, we're only using it for automatic fetching of external dependencies.)

  1. Can I specify more than one pom.xml?  Or can I make a pom.xml that depends on all other modules without confusing intellij?
  2. How can I fix this error?  (I don't see it in intellij.)
    [not-dependency module] [WARNING] The POM for dependency1:version is missing, no dependency information available


Thanks.

0
Comment actions Permalink

This question is a bit out of scope for TeamCity, but I believe there is a solution in Maven.

Please, use Maven documentation on dependencies, note the "Importing Dependencies" section. I think "Bill of materials" pattern is what you need.

0
Comment actions Permalink

great.  that seems to work.  i had to adjust my dependencies to use:

            <type>pom</type>

to resolve (2)

EDIT: that works fine for maven but breaks intellij.  it removes all my inter-module dependencies.

0

Please sign in to leave a comment.