I guess you're building from the 'integration' project, not the aggregating
project (ejbs)?
If that's the case, your scenario is the expected way for it to work. Your
dependency is to an artifact (the built jar), not a Maven project on your
local disk. So you need to build the core project first. If you build from
the aggregating project it will be handled correctly. Or you use some tool
to help you (m2eclipse).
If you find yourself updating updating two different projects, then your
separation might not be right.

/Anders

On Wed, Sep 9, 2009 at 09:17, Thomas Jonsson <[email protected]>wrote:

> Hi!
>
> I was just wondering if have misunderstood the basics of Maven and
> dependencies.
> I have a project according to this structure:
>
> ear
> ejbs
>   core
>   integration
> webapps
>   webapp
>
> integration is dependent on core.
>
> from pom in integration.xml:
> <dependency>
>        <groupId>com.jf.application.ejbs</groupId>
>        <artifactId>core</artifactId>
>        <version>${pom.version}</version>
>        <scope>compile</scope>
> </dependency>
>
> pom in ejbs:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd";>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.jf.application</groupId>
>   <artifactId>ejbs</artifactId>
>   <packaging>pom</packaging>
>   <name>ejbs</name>
>   <parent>
>      <groupId>com.jf</groupId>
>      <artifactId>application</artifactId>
>      <version>2010v-SNAPSHOT</version>
>   </parent>
>
>   <modules>
>      <module>core</module>
>      <module>integration</module>
>    </modules>
> </project>
>
> When a run mvn clean:compile in the project root a I get a compilation
> error saying that a method is missing. I recently added the method in
> one of the classes in the core project. When I debug a see that the
> classpath for core is the installed artifact in the local maven repo
> and not the classpath to core in the project. Should it be this way?
> I think it seems silly that I have to install the core artifact first.
>
> I'm running Maven 2.2.1 on windows.
>
> Any ideas?
>
> Best regards,
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to