Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scope inheritence in pom

 
Michael Bespalov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to add a jar in [test] scope to a certain project. The problem is, that this jar has a dependency to another jar in [compile], while my goal is to restrict the whole dependency tree from that jar to [test]
Is there a way to do so? I've tried explicitly adding the other dependency in [test] scope, but it didn't seem to work. I see the following: [test] (not updated from compile)

Any help would be appreciated
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Probably I'm wrong but 'compile' phase precedes 'test' phase so if you restrict scope to test, you include compile.
Adding the 2 jars in compile phase doesn't work?


Best regards,
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while my goal is to restrict the whole dependency tree from that jar to [test]

Why do you want to do that? The one dependency in common is required for compiling your code, I don't see why a shared dependency could not appear in multiple scopes

I see the following: [test] (not updated from compile)

Where do you see this? What is the context?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic