You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by thisguy <bo...@yahoo.com> on 2010/10/15 16:12:54 UTC

dependency evaluation order

Hi, I have two projects, A and B.  B has a dependency on A.  A's output (jar)
is in my repository.

Now say I want to change A's java code and then run B to see my changes.  B
will look in the repository for A's jar right?  I don't want it to do that
during development.  I want B to use the local file system to get the new
version of the A jar because I haven't deployed A to the repository yet. 
Does that make sense?  Is there a nice mechanism to tell maven to use local
project directory dependencies before searching the repository?  Thanks.
-- 
View this message in context: http://maven.40175.n5.nabble.com/dependency-evaluation-order-tp3213753p3213753.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: dependency evaluation order

Posted by Samuel Rash <sl...@facebook.com>.
if A has a pom file, mvn install will install it in your ~/.m2/repository (which maven searches before using the remote repository)

if it's not 'mavenized', you can use mvn install:install-file

http://maven.apache.org/plugins/maven-install-plugin/usage.html

Just make sure your dependency spec in B matches the one you install locally (and probably best it's different than the one in the remote)

-sr

On Oct 15, 2010, at 7:12 AM, thisguy wrote:


Hi, I have two projects, A and B.  B has a dependency on A.  A's output (jar)
is in my repository.

Now say I want to change A's java code and then run B to see my changes.  B
will look in the repository for A's jar right?  I don't want it to do that
during development.  I want B to use the local file system to get the new
version of the A jar because I haven't deployed A to the repository yet.
Does that make sense?  Is there a nice mechanism to tell maven to use local
project directory dependencies before searching the repository?  Thanks.
--
View this message in context: http://maven.40175.n5.nabble.com/dependency-evaluation-order-tp3213753p3213753.html
Sent from the Maven - Users mailing list archive at Nabble.com<http://Nabble.com>.

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


Sam Rash
sl.rash@facebook.com<ma...@facebook.com>




Re: dependency evaluation order

Posted by Ron Wheeler <rw...@artifact-software.com>.
  On 15/10/2010 10:35 AM, Antonio Petrelli wrote:
> 2010/10/15 Wendy Smoak<ws...@gmail.com>:
>> On Fri, Oct 15, 2010 at 10:12 AM, thisguy<bo...@yahoo.com>  wrote:
>>> Hi, I have two projects, A and B.  B has a dependency on A.  A's output (jar)
>>> is in my repository.
>>>
>>> Now say I want to change A's java code and then run B to see my changes.  B
>>> will look in the repository for A's jar right?  I don't want it to do that
>>> during development.  I want B to use the local file system to get the new
>>> version of the A jar because I haven't deployed A to the repository yet.
>>> Does that make sense?  Is there a nice mechanism to tell maven to use local
>>> project directory dependencies before searching the repository?  Thanks.
>> Most IDEs can deal with this situation for you.  What are you using?
> In particular, using m2eclipse with "workspace resolution" enabled
> (that is the default) does what you need.
That gets it out of your active projects (Eclipse workspace after "build 
of A") rather than your local repository(~.m2) version of A after install.
Not always what you want but usually is OK.
Just be aware of the difference.

Ron

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


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


Re: dependency evaluation order

Posted by Antonio Petrelli <an...@gmail.com>.
2010/10/15 Wendy Smoak <ws...@gmail.com>:
> On Fri, Oct 15, 2010 at 10:12 AM, thisguy <bo...@yahoo.com> wrote:
>>
>> Hi, I have two projects, A and B.  B has a dependency on A.  A's output (jar)
>> is in my repository.
>>
>> Now say I want to change A's java code and then run B to see my changes.  B
>> will look in the repository for A's jar right?  I don't want it to do that
>> during development.  I want B to use the local file system to get the new
>> version of the A jar because I haven't deployed A to the repository yet.
>> Does that make sense?  Is there a nice mechanism to tell maven to use local
>> project directory dependencies before searching the repository?  Thanks.
>
> Most IDEs can deal with this situation for you.  What are you using?

In particular, using m2eclipse with "workspace resolution" enabled
(that is the default) does what you need.

Antonio

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


Re: dependency evaluation order

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Oct 15, 2010 at 10:12 AM, thisguy <bo...@yahoo.com> wrote:
>
> Hi, I have two projects, A and B.  B has a dependency on A.  A's output (jar)
> is in my repository.
>
> Now say I want to change A's java code and then run B to see my changes.  B
> will look in the repository for A's jar right?  I don't want it to do that
> during development.  I want B to use the local file system to get the new
> version of the A jar because I haven't deployed A to the repository yet.
> Does that make sense?  Is there a nice mechanism to tell maven to use local
> project directory dependencies before searching the repository?  Thanks.

Most IDEs can deal with this situation for you.  What are you using?

What Maven command are you using to build?  Are you using -SNAPSHOT
version numbers?

Are A and B part of the same multi-module project under a parent pom?
If so, then building "from the top" (parent) will do what you want.

If you are down in B, Maven will look in the repository (first local,
then remote) for A's jar.

(Assuming they are totally separate projects,) you don't have to
deploy your A jar to a remote repository, but you do need to get it
into your local repo with 'mvn install' in order for B to see it.

Lots of details missing here, hopefully those random bits of advice will help.

-- 
Wendy

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