File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Scope inheritence in pom Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Scope inheritence in pom" Watch "Scope inheritence in pom" New topic
Author

Scope inheritence in pom

Michael Bespalov
Greenhorn

Joined: May 02, 2013
Posts: 1
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

Joined: Apr 19, 2013
Posts: 199
    
    1
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

Joined: May 14, 2008
Posts: 5827
    
    7

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?


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scope inheritence in pom