You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Daniele Dellafiore <il...@gmail.com> on 2010/10/19 18:17:10 UTC

A project uses a resource defined in a module that it does not depends upon

Hi, I have this situation.

Project A and B have many modules. Everyone has a configuration in
which the root pom defines modules and all the dependency management,
all the submodules uses root A pom as parent. Before I used to have a
separate parent project as onother module but in the end did not seem
really necessary.

Module B1 uses some of the modules of A, but not everyone,

now, I expect that if B1 depends on A1 and A2, it will not have any
relation to A3.
But what happens? That B1 see a file in the classpath of A3, to be
precise, spring loads a properties file that is in
A3/src/main/resources, overriding other properties.
In fact, if from A pom I remove the A3 modulo, the properties file is
not loaded anymore.

I suspect that this happen because A1/2/3 all has A as parent pom.
But this behavior really seem strange to me.

-- 
Daniele Dellafiore
http://danieledellafiore.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: A project uses a resource defined in a module that it does not depends upon

Posted by Vincent Latombe <vi...@gmail.com>.
Without any example project (at least the pom.xml for the different
modules), I don't think anybody will be able to help you.

Have you checked dependency:tree on B1?

2010/10/19 Daniele Dellafiore <il...@gmail.com>

> Hi, I have this situation.
>
> Project A and B have many modules. Everyone has a configuration in
> which the root pom defines modules and all the dependency management,
> all the submodules uses root A pom as parent. Before I used to have a
> separate parent project as onother module but in the end did not seem
> really necessary.
>
> Module B1 uses some of the modules of A, but not everyone,
>
> now, I expect that if B1 depends on A1 and A2, it will not have any
> relation to A3.
> But what happens? That B1 see a file in the classpath of A3, to be
> precise, spring loads a properties file that is in
> A3/src/main/resources, overriding other properties.
> In fact, if from A pom I remove the A3 modulo, the properties file is
> not loaded anymore.
>
> I suspect that this happen because A1/2/3 all has A as parent pom.
> But this behavior really seem strange to me.
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Vincent

Re: A project uses a resource defined in a module that it does not depends upon

Posted by Wayne Fay <wa...@gmail.com>.
> But what happens? That B1 see a file in the classpath of A3, to be
> precise, spring loads a properties file that is in
> A3/src/main/resources, overriding other properties.

How does Spring even see the file in A3? What kind of package are you
assembling for B1? How do you "run" B1?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org