aspose 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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 5779
    
    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
 
Similar Threads
Java Security Exception
Spring 3.0.2 and Active MQ 5.4.1 Issues
Unable to create one single jar file in maven with dependencies included inside
maven classpath - driver not found
Could not resolve dependencies for maven project