0

I am using maven-gae-plugin from http://code.google.com/p/maven-gae-plugin/ to create a multi-module project using inheritance (parent-project reference)

The structure that I have is as below:

|
`-- pom.xml
|-- base-api-project (packaging=jar)
|   `-- pom.xml
|-- main-www-project (packaging=war)
|   `-- pom.xml

The root pom.xml is configured as parent + aggregator (with reference to the modules).

When I build using the root pom.xml, everything is compiled and packaged great.

However, when I run mvn gae:run in the main-www-project folder, I get an error that the base-api-project is not found in the registered repositories. I scans all registered repositories...

But my question is... if it's already there in ~/.m2/repository, then why should I hunt across the net?

I there something wrong that I'm doing?

gvaish
  • 9,374
  • 3
  • 38
  • 43

1 Answers1

0

When using snapshot versions maven will always look for the latest snapshot, whereas releases will be resolved locally first.
However, each artifact in the local repo will also need the corresponding POM, and that POM may declare dependencies that are not in the local repo, or are snapshot versions (etc. recursively).

crowne
  • 8,456
  • 3
  • 35
  • 50
  • Am aware of the SNAPSHOT version... so, I haven't used it. But no luck! :( Do you think "parent"-ing can be an issue? Both the projects have a common parent... btw, if I build them independently, ie, without parent-hierarchy, the stuff works fantastic. – gvaish May 05 '12 at 18:06
  • And the local pom's do exist locally. – gvaish May 05 '12 at 18:07
  • The common parent structure should not be an 'issue', its a good pattern. Try doing a mvn install from root and then gae:run – crowne May 06 '12 at 06:23
  • That worked. But why should that be? "mvn install" will install all three in the local repo. – gvaish May 06 '12 at 08:45
  • When you said, "the local pom's exist locally", did you mean in the project structure or in the local repo. Because maven does not resolve poms in the project structure, only in the repo, local first then remote if not found in local. – crowne May 06 '12 at 11:12
  • I meant... repo ~/.m2/repository/... btw, I think (probably) the reason is that it failed to locate the parent project in the local repo (~/.m2/...). So, once I install the parent + base-api projects, I can then compile+package+gae:run the main-www project. Not sure if this is the expected behaviour! – gvaish May 06 '12 at 13:53