Here's the steps as I understand them: 1) It sees the dependency. 2) It attempts to get the dependency's POM, so that it can resolve transitive dependencies. 3) It sees the <parent> element in the dependency's POM. 4) It attempts to get the parent POM so it can have all the information it needs for transitive dependencies.
I assume the problem is the parent project has NOT been installed into the local repo using mvn install. When you remove the dependency, it's ok, because it find the parent pom using the <relativePath> element (or it's default, the directory above). When it tries to find it for the dependency, however, it doesn't have access to this relativePath, so it looks it up the normal way, which is to look in the local repo, and if not found, in the remote repos. -Stephen On 3/17/06, Rune Flobakk <[EMAIL PROTECTED]> wrote: > Hi! > I've just begun to make a Maven 1 project into a Maven 2 project. The > project consists of a parent project with a few sub projects. > > One of the subprojects depends on another, and with the Maven 1 project > I can on the dependee project run 'maven jar:install' to install it to > the local repository, and the project depending on it will fetch it when > compiling its source. > > I've managed to make a functional Maven 2 project on the dependee > project and installed it to the local Maven 2 repository using 'mvn > install'. The project installs nicely to C:\Documents and > Settings\Rune\.m2\repository\wsu_khepera\simulator\1.0\simulator-1.0.jar. > > Now, for the project depending on the just installed artifact, I have > defined in pom.xml: > > <dependencies> > <dependency> > <artifactId>simulator</artifactId> > <groupId>wsu_khepera</groupId> > <version>1.0</version> > </dependency> > </dependencies> > > But when running 'mvn compile' it seems to try to fetch the parent > project from the repository, and the first downloading-message I get is > this: > > Downloading: > http://repo1.maven.org/maven2/tdt4240/group10/robot/0.1/robot-0.1.pom > > I'm assuming it has already looked in the local repository when trying > to download from the default remote one? > > Why is it looking for the groupId 'tdt4240.group10', artifactId 'robot', > version '0.1' which is the parent project, instead of the one I've > defined as a dependency? I assume it finds the parent project which I've > defined already with <parent>...</parent>, because if I remove the > defined dependency and try to compile, I get no errors about missing > parent project (but of course compile errors because of the dependency > project). > > I'm a bit stuck on this one, and hope somebody can shed some light on > this matter. I'm very familiar with these concepts from Maven 1, but > have just started to use Maven 2. If I need to provide more info, please > tell me. > > Cheers, > Rune > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Stephen Duncan Jr www.stephenduncanjr.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
